Question: Write a C++ program for the simple counting tool that reads lines from a file until the end of file. The program should prompt
Write a C++ program for the simple counting tool that reads lines from a file until the end of file. The program should prompt the user for the file name to read from. The program should open the file for reading, and if the file cannot be opened, it should print the message "File cannot be opened ", followed by the filename, and exit. The program should consider the first word following the '%' character of a command line as a command name. If no word is found, or a word is not recognized as one of the three commands, an error message should be printed out followed by the line number. See the example below for the format of the error message.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
