Question: Write a program using c++ that analyzes the contents of a text file and produces the following results: 1) the number of words in the

Write a program using c++ that analyzes the contents of a text file and produces the following results:

1) the number of words in the text file

2) the number of unique words in the text file

3) the number of characters in the text file

4) the number of occurrences of each lower case letter in the alphabet

5) the number of occurrences of each upper case letter in the alphabet

6) the frequency of each letter, both upper case and lower case, in the alphabet.

The program should prompt the user for the name of a text file and then analyze the text to generate the results described above. If the file does not exit, the program should report the error and give the user another try to enter another file name. If the number of tries exceeds 5, the program should display an appropriate error message and exits. Use functions to make the development process manageable and structure your code into multiple files. Make sure you document the functions you introduce by writing concise, precise and clear comments before you introduce the prototype of each function.

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!