1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ehidna [41]
3 years ago
5

Write a program that takes paragraph from the user and prints all unique words in that paragraph using strings in c++

Computers and Technology
1 answer:
Bezzdna [24]3 years ago
5 0

Answer:

void printUniquedWords(char filename[])

void printUniquedWords(char filename[]) {

void printUniquedWords(char filename[]) {     // Whatever your t.text file is

    fstream fs(filename);

    fstream fs(filename);   

    fstream fs(filename);       

    fstream fs(filename);           map<string, int> mp;

    fstream fs(filename);           map<string, int> mp;   

    fstream fs(filename);           map<string, int> mp;       // This serves to keep a record of the words

    string word;

    string word;     while (fs >> word)

    string word;     while (fs >> word)     {

    string word;     while (fs >> word)     {         // Verifies if this is the first time the word appears hence "unique word"

        if (!mp.count(word))

        if (!mp.count(word))             mp.insert(make_pair(word, 1));

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }   

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();   

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)             cout << p->first << endl;

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)             cout << p->first << endl;     }

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)             cout << p->first << endl;     } }

You might be interested in
What is the output of the following program?
Kamila [148]

Answer:

0

3

6

Explanation:

7 0
2 years ago
Select the three careers in the creative side of digital media.
MrRa [10]

Answer:

I would pick A B and D to be my answer

6 0
2 years ago
A stack is initially empty, then the following commands are performed: push 5, push 7, pop, push 10, push 5, pop, which of the f
MatroZZZ [7]

Answer:

d

Explanation:

6 0
3 years ago
Which of these can a worksheet within a spreadsheet contain?
Lisa [10]
<span>d) all of these is your correct answer</span>
3 0
3 years ago
Read 2 more answers
​Browser-based database applications differ from traditional applications in that they​ ________.
alukav5142 [94]

Answer:

The correct option to the following question is option A.

Explanation:

Traditional database system is also known as the data warehouses and the relational database system which have been primary way organizations and the businesses have analyzed and stored their data and information for past 20 to 50 years. Traditional application of database systems are designed from ground up to the work with the data that has the primarily structured data.

A Web database or a browser-based database is the database application which is designed for accessed and managed from the Internet. Website or browser operators can be manage the collection of present analytical results-based and data on the data in the Browser-based database application.

8 0
3 years ago
Other questions:
  • What is the central unit of the computer that contains the logic circuitry and carries out the instructions of the computer's pr
    13·1 answer
  • In Word, blue underlining indicates which of these problems?
    12·1 answer
  • Which statement accurately describes DTP programs?
    11·1 answer
  • Which is a natural hazard that can cause extinctions? Choose all that apply.
    6·1 answer
  • In Access, it is possible to have _______________ fields, that is, fields that can contain more than one value.
    9·1 answer
  • Translation of a file into a coded Format that occupies less space than the original file is called
    6·1 answer
  • Abby wants to simply share a snapshot of her calendar with another user. Which option should she choose to achieve
    15·1 answer
  • What are the steps to creating a blank database? Use the drop-down menus to complete them.
    9·1 answer
  • Complete the implementation of the following methods:__init__hasNext()next()getFirstToken()getNextToken()nextChar()skipWhiteSpac
    11·1 answer
  • Tại sao xe chỉ sản xuất ra 1996cc mà không phải là 2000cc?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!