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
Sino ang pinaka matalino sa math sa buong mundo​
Svetllana [295]

Answer:

lahat ng tao ay matalino kasama ka na dun kaya lang di natin ito inilalabas dahil natatamad tayo

6 0
3 years ago
Read 2 more answers
What is one way to measure technological progress?
OLga [1]
You can measure it by the amount of automatisation. The bigger technological process the easier it is to automate systems.
4 0
3 years ago
Applying what formatting option to your excel workbook will make it easier to read when printed out?
blagie [28]
Portrait, as well as 100 percent scale.
8 0
2 years ago
Copyrighted software illegally downloaded and sold by organized groups without a license to do so is called:
trasher [3.6K]
Copyrighted software illegally downloaded and sold by organized groups without a license is called Warez
5 0
3 years ago
If you have created a document that contains a table that is 10 inches wide and 4 inches high, you will want to print the docume
Papessa [141]
True you will want to print the document in Landscape orientation
6 0
3 years ago
Read 2 more answers
Other questions:
  • You notice that lately your computer has been running slow. When you open up your web browser, you get endless pop-up ads to the
    8·1 answer
  • When talking about changes related to information​ technology, the text identifies three interrelated changes that are responsib
    8·1 answer
  • Qbasic program to accept 10 numbers and to find their sum. <br>​
    7·1 answer
  • At the beginning of Section 5.2, it is stated that multiprogramming and multiprocessing present the same problems, with respect
    8·1 answer
  • If, when asked for a date of birth, the user enters a future date, this error should be caught by a ________ check.
    8·1 answer
  • Where can elicitation techniques be used?
    12·1 answer
  • Match the IP Protections Patent, Copyright and Trademark into the following cases:
    12·1 answer
  • Class 10 computer unit 1 all excersise​
    12·1 answer
  • Design a loop that asks the user to enter a number. The loop should iterate 10
    15·1 answer
  • Drag each tile to the correct box.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!