Question: In C++ In this assignment, you will create a program that counts the frequencies of some characters and print the result to an output file.

In C++

In this assignment, you will create a program that counts the frequencies of some characters and print the result to an output file. For the current usage trends in English, the characters E, T, A, O, I, N, S, H and R are the most common ones. Your program will count the occurrences of each of these characters in the input file, and output the number of occurrences of each character, and also the total number of characters. The program should handle multiple files in a single execution.The program first prompts for the number of lfies to be processed and the name of the file where the results should be written; for each file it prompts for the name of the file, and prints the results to the specified output file. As an example, a sample run should look something like this:

Welcome! How many files are you processing: 2

Please input the name of the output file: Counts.txt

Please input the name of the file: FirstFile.txt

FirstFile.txt has been processed.

Please input the name of the file: AnotherFile.txt

AnotherFile.txt has been processed.

Thank-you, Goodbye!

The output file (Counts.txt) should look something like this:

File name: FirstFile.txt

Number of E's: 19

Number of T's: 15

Number of A's: 19

Number of O's: 9

Number of I's: 2

Number of N's: 7

Number of S's: 11

Number of H's: 4

Number of R's: 10

Total Number of characters: 237

-----------------------------------------------

File name: AnotherFile.txt

Number of E's: 16

Number of T's: 11

Number of A's: 13

Number of O's: 9

Number of I's: 2

Number of N's: 13

Number of S's: 11

Number of H's: 5

Number of R's: 11

Total Number of characters: 197

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!