Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago