Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a C++ Program that reads characters from a file and counts and tracks the number of: Total Characters Read Letters Vowels Consonants Numbers Punctuation
Design a C++ Program that reads characters from a file and counts and tracks the number of:
Total Characters Read
Letters
Vowels
Consonants
Numbers
Punctuation
White Space (Space, Tab, or Newline Characters)
*Hint: You can determine some counts using some of the other counts listed above.
The program should prompt the user for the name of the file to open. You should display an error message if you cannot open the file.
* i.e. using input.inFile (outtest.txt); //to open and read the file
If the input file opens successfully, make sure to close the input file before displaying the count information to the user on the screen.
If the input file opens successfully, open an output file named charsCounts.txt and write the count information to the file. If the output file opens successfully, remember to close it. Otherwise, display an error message that the output file could not be opened.
The program should include a loop that allows the user to run the program until they want to exit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started