
void calculateAverage(ifstream& fin,
ofstream& fout, double& average)
char calculateGrade(double average)
bool generateOutputFile()
Your program logic should work as follows. Invoke generateOutputFile from main. Inside generateOutputFile you should request the input filename from the user and the output filename as well. If the input file does not exist, this function should return false to main and you should terminate the program with an appropriate error message.
As long as the file exists, you should then output some headers to the file (student name, test 1, test 2, etc) and then get a while loop going to read the data. Here's where stuff gets interesting. You'll read in the name and write it to the file then you'll invoke calculateAverage, sending it the two file handles and the average variable by address.
calculateAverage will read in the five test scores, write them to the output file, and calculate the test average from them. Back in generateOutputFile, you'll have access to the average (since it was passed by address and not by value) and you can use it to call calculateGrade.
calculateGrade should be a series of if statements, each one returning a letter grade based on the test average sent to the function.
Sample Output
Here is a screenshot of my code running.
Calculate Grades output
This is a screenshot of my output file.

finalGrades
The input file I used.
Refer to the deliverables post for comment formatting and required program identification information.
Due Date:
Sunday, November 14th, 6:00pm