Professor Nutty, who lectures encephalopathy (Med 7010), at the Cajun
Medical School gave three equally weighted exams to his students during the
course (preliminary, middle, and terminal exams). The students’ scores are
kept in a text file. Each row of the text file consists of the student’s ID#
followed by his/her test scores. At the end of the course, Professor Nutty
needs a C++ program that computes average test scores and letter grades
for each student. Professor Nutty wants a report consisting of each student’s
best two scores, the average of the best two scores, and the letter grade
corresponding to the average. In other words, Professor Nutty will drop the
lowest exam score. The exam scores are not sorted in the input file.
Your program will prompt the user for the name of the input file and
read the data from it. Your program will generate a report showing the
ID#, the best two scores, the average of the best two scores and letter grade
corresponding to the average. The report will be stored in an output text
file whose name the user will be prompted to enter.
Your program should prompt the user for the name of the input and out-put files. Be sure to perform error-check on both files to determine whetherthe input file issuccessfully opened and whether the output file is successfullycreated. Your program should then generate a report following the formatbelow. Ensure that numericvalues in the report are formatted so that theyhave the same number of decimal places as shown in the sample output be-low. Once the data from the input file havebeen processed, close the file.Also, close the output file before the program terminates.
For a sample input file, ence7010f11.grd, with the data below:
2008-EN-00195 80 100
2009-NE-09560 98 97.5
2011-PA-158 80 70 50
A typical program interaction would be:
Enter the name of the data file> ence7010f11.grd
Enter the name of the output file> ence7010f11.rpt
Here is the contents of the sample output file (ence7010f11.rpt):
Final Course Report
ID# Score Average Grade
2008-EN-001 95.00% 97.500% A
2009-NE-095 97.50% 97.750% A
2011-PA-158 70.00% 75.000% C
*** END OF REPORT ***
I will rate lifesaver for any help that can be given! Thank you for looking!