Question: Write a C + + program whose main function is merely a collection of variable declarations and function calls. This program reads in text and

Write a C++ program whose main function is merely a collection of variable declarations and function calls. This program reads in text and outputs the letters, together with their counts. You are not allowed to use global variables. All information must be passed in and out of the functions. You will use an array to keep a count for all of the letters. Both the input file and output file must be given by the user. Your program will be broken up into 4 functions, in four different files. Because they are in different files, you are being forced to not use global variables. One of the files is given to you (main.cpp).
You will be given 3 other files, that are all .hpp files. Your job is to write the 3 functions, openFiles, count, and printResults in the three different files.
InputOutput openFiles()
Opens the input and output files. It will throw an error if something is wrong. There are three edge cases:
If it there are an incorrect amount of input parameters, it will throw an IncorrectParameters error.
If it fails to open the input file, throw a InvalidInputFile error
It if fails to open the output file, throw an InvalidOutputFile error
count()
Counts every occurrence of capital letters A-Z and small letters a-z in the text file opened in the function openFile.
printResult()
Prints the number of capital letters and small letters, as well as the percentage of both. Don't include non letters in the count for getting the percentage
The format of each line needs to line up to the right
Few other key logistics:
The program takes in two command line arguments, input and output
Example[x].txt corresponds with output[x].txt

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!