Question: For this computer assignment, you are to write and implement an interactive C++ program to scan and process a stream of words of a plain

 For this computer assignment, you are to write and implement aninteractive C++ program to scan and process a stream of words ofa plain text Your program should start with an empty list ofwords. (Combinations of blanks, tabs, and newline characters to separate words.) After

For this computer assignment, you are to write and implement an interactive C++ program to scan and process a stream of words of a plain text Your program should start with an empty list of words. (Combinations of blanks, tabs, and newline characters to separate words.) After reading each word from the input stream, do the followings Check the word for punctuation marks. If the first letter of the word is preceded or its last letter is followed by punctuation marks, delete them from the word; however, if a word contains punctuation marks in the middle, ignore the letters beyond these punctuation marks. For example, if the word is fish, then the resulting word should be fish; however, if the word is fish net then the resulting word should still be fish. in 1. Use a map container to store the words, where each word is represented by a pair . The first element of the pair, named first, contains the name of the input word, and the second element of the pair, named second, contains its frequency in the input stream. To use a map container in your program, you need to insert the statement: #include in your header file, and to use the functions in the STL, you also need to insert the statement: #include in your header file. 2. In addition to the main () routine, implement the following subroutines in your program . void get words map & ): It gets a word from the input stream and removes its punctuation marks . void print words ( const map&): It prints the final list of words and their frequencies. It also prints the number of nonempty words and the number of distinct words in the input stream . void clean entry (const string&, string&): It cleans a word from its punctuation marks. The first argument is the original word in the input stream and the second argument contains the same word after cleaning

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!