Grade Book Report
hardQuestion 594Write a function void gradeReport(const string& filename). Each line of the file holds a student's name followed by three integer scores, separated by single spaces:
Ann 80 85 90 Bob 70 76 82
For every student, in file order, print the name, a colon, a space and the average of that student's three scores with exactly one digit after the decimal point. After all students, print Class average: followed by the average of the per-student averages, also with one decimal place. The output for the file above is exactly what is shown in Expected Output.
If the file cannot be opened, or it opens but contains no students, print the single line No data and nothing else. One test passes missing_dir/grades.txt and another passes an empty file.
Do NOT write a main function.
Expected output
Ann: 85.0 Bob: 76.0 Class average: 80.5 No data No data
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...