Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming Question: The program should: 1. Read the name of the text file from the console. 2. Read in a text file, not all

C++ Programming Question:

The program should:

1. Read the name of the text file from the console.

2. Read in a text file, not all at once. (This can be line by line, word by word or character by character.)

3. The file content must be converted to a sequence of words, discarding punctuation and folding all letters into lower case.

4. Store the unique words and maintain a count of each different word.

5. The words should be ordered by decreasing count and, if there are multiple words with the same count, alphabetically. (This ordering may be achieved as the words are read in, partially as the words are read or at the end of all input processing.)

6. Output the first ten words in the sorted list, along with their counts.

7. Output the last ten words in the list, along with their counts. You must choose appropriate data structures and algorithms to accomplish this task.

Note: in the context of this task, appropriate choices will be efficient and will not use excessive instructions or data.

Note: where a punctuation mark appears between two letters, the sequence is to be treated as a single word. Thus, its will become its, youll will become youll and loop-hole will become loophole.

Note: you can assume that the input file contains no more than 50,000 different words.

Thank you!

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Discuss the steps of a generic change project.

Answered: 1 week ago

Question

3. What information do participants need?

Answered: 1 week ago