Question: Write a C++ program that reads from a file specified in the command line as an argument. The program should read from the file words

Write a C++ program that reads from a file specified in the command line as an argument. The program should read from the file words until the end of file. In case the file is empty, print out on a new line the message "File is empty." and then exit. However, if no file name is provided, the program should print on a new line "NO SPECIFIED INPUT FILE NAME.", and exit. If the file cannot be opened, print on a new line "CANNOT OPEN THE FILE ", followed by the file name, and exit. A word is defined as a sequence of one or more non-whitespace characters separated by whitespace. Given a list of prepositions, the program should keep a record of the number of occurrences of each preposition in the list that is seen in the input file. The program should create a simple directory using the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
