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 represents the loss of a network signal strength measured in decibels (dB) and occurs because the transmissions gradually d
alexandr402 [8]

Answer:

Attenuation is the one-word answer which is the correct answer for the above question.  

Explanation:

Attenuation is a concept which told about the barrier, which is used to stop the signals in the connected network systems. Attenuation can be a form of any type of barrier like weak signals, or because of long-distance.

Following are the example which is in the form of attenuation--

  1. Noise
  2. The distance can also be a problem for weak signals.
  3. Hacker also disestablished the network signals.
  4. The physical objects.

Hence the attenuation can be formed by any of the barriers of signals, like physical obstruction, longer distance, and radio inference.

7 0
3 years ago
For successful completion of an 8-Week course, how often should I visit the course web site to check for new e-mail and any inst
Brilliant_brown [7]

Answer: The course web should be visited daily to check for new e-mail and any instructor announcement.

Explanation:

For any serious-minded and Intellectually inclined individual, who aimed for a successful completion of an 8-Week course, it's imperative for him/her to visit the course web site daily to check for new e-mail and any instructor announcements.

8 0
3 years ago
If a web page visitor clears the analytics cookie from their browser, what will occur?
katrin2010 [14]

Answer:

If a web page visitor clears the Analytics cookie from their browser, Analytics will not be able to associate user behavior data with past data collected. ... It will set a new browser cookie the next time a browser loads a tracked page.

6 0
3 years ago
What helps to identify trends?
vagabundo [1.1K]
Pie graph but idk if thats the answer
4 0
4 years ago
Read 2 more answers
Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in
Firdavs [7]

Answer:

RTT1+ RTT2+..... RTTn

Explanation:

The total estimated time to get the IP address is

RTT1+ RTT2+..... RTTn

Once the IP address is known, O RTT elapses to set up the TCP connection and another O RTT elapses to request and receive the small object. The total response time is

2RTT0+RTT1+RTT2+.....RTTn

7 0
3 years ago
Other questions:
  • Pressing the Ctrl+Home keys moves the insertion point to the
    5·1 answer
  • Where is the inductive pickup placed when performing in starter current draw test?
    9·1 answer
  • A multistep protocol used to identify and control potential threats to food-safety is the
    8·1 answer
  • Difference between video game laser and projectile
    9·1 answer
  • If Mary makes homemade jams that she sells to her local grocer, she is practicing:
    10·1 answer
  • With the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
    13·1 answer
  • Technology never has negative consequences for society. true or false.
    11·1 answer
  • When you check the spelling in a document, one of the options is to add unrecognized words to the dictionary. If you were workin
    8·1 answer
  • Why is it hard for some people to keep a promise even one that they make to themselves​
    10·2 answers
  • Area of circle algorithm
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!