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
Binary subtraction<br> Subtract (111) from (1000)
AfilCa [17]

Answer:

889

Explanation:

it is this Nswerjhjhjjjkkkkjjnnnnnn

7 0
1 year ago
Company-wide systems that connect one or more local area networks (LANs) or wide area networks (WANs) are called _____. a) legac
il63 [147K]

Answer:

The answer is "option c".

Explanation:

A Web-centered view ensures anything has been programmed for the Web app or program. example Webified. This is a definition, that is used for personal use only and all other duplication is strictly forbidden without the approval of the author. and other options are not correct that can be defined as:

  • In option a, the legacy system is a method that is obsoleted today.
  • In option b, The mission-critical systems are used in the navigational system.
  • In option d, A distributed system permits the sharing of information that includes software that is connected with a network.

6 0
3 years ago
Develop a program that will calculate the area and perimeter of a rectangle. The length and width can be given as constant.(LENG
o-na [289]

Answer:

#include <iostream>

using namespace std;

int main()

{

 

  int length = 8;

  int width = 8;

 

  int perimeter = 2*(length + width);

  int area = length * width;

 

  cout<<"The perimeter is "<<perimeter<<endl;

  cout<<"The area is "<<area<<endl;

 

  return 0;

}

Explanation:

include the library iostream for using the input/output instructions in the c++ programming.

Create the main function and define the variable length and width with values.

Then, use the formula for calculating the perimeter and area of rectangle.

perimeter = 2*(length + width)

area = length * width

and store in the variables and finally print the output.

8 0
3 years ago
A ____ is a program that lets computer users create and access a collection of organized data.
ruslelena [56]
Database management system
5 0
3 years ago
Suppose list1 is an MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code:
hjlf

Answer:

The correct answer for the given question is " The Code fragment A runs fastly than the code fragment of B".

Explanation:

In this question there are some information is missing i. e options. The question does not give any options. The options for the given question is given below

(A.) The Code fragment A runs fastly than the code fragment of B.

(B.) The Code fragment B runs fastly than code fragment of  A.

(C)  The Code fragment A runs as fastly as code fragment of B.  

So we conclude the answer i.e option(A) because As given in the question list1  is a MyArrayList and list2 is a MyLinkedList.  , in list1 we fetching the data easily and fastly means that it remove the data easily as compare to list2 As MyArrayList is storing the list only and also we can fetch the data easily manner.

The list2 is an object of MyLinkedList means that it manipulating the data fastly as compared to MyArrayList but if we compared the fetching of data then  MyArrayList is a better option so the code fragment runs fastly then code fragmented B.

7 0
3 years ago
Other questions:
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • Organizing speech ideas according to physical space, direction, or location calls for a _____ organizational pattern.
    11·1 answer
  • Can a idler gear increase or decrease torque?
    7·1 answer
  • Write a program that prompts the user to enter three words. The program will then sort the words in alphabetical order, and disp
    14·1 answer
  • Adam has designed and tested an Android app for a startup. The client expects to get quick responses to the app. After consultin
    7·1 answer
  • Microsoft Word, Google Chrome, and Windows Media Player are examples of
    15·1 answer
  • All _______ that store more than one piece of data ​
    12·1 answer
  • How is technology moving the business world forward?
    13·1 answer
  • In what ways are super computer different from mainframe computers.​
    10·1 answer
  • the php function that is executed is a connection to a database cannot be made is the____ function. die | isset| end | connect.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!