Write a C++ program that will compute the final average and assign a grade for the students in a class.
The input file named "class_data.txt" will have the following format:
one line for each student containing the following, separated by at least one space:
student ID
7 programming assignment scores
1 midterm score
1 final exam score
example:
A00123456 92 95 97 88 83 84 70 80 90
Assume the following (you do not need to validate these things):
Write the output to an output file named "grade_report.txt".
The program should output the student ID, the final average (computed according to the given weights below) formatted to 1 decimal place, and the letter grade (computed according to the grading scale below) for each student.
The grading scale:
Score Grade
90 - 100 A
80 - 89.9 B
70 - 79.9 C
60 - 69.9 D
0 - 59.9 F
The weights for each category:
Programming Assignments*: 25%
Midterm Exam: 30%
Final Exam: 45%
*7 programming assignments,
the lowest score is dropped.
Here is an example of how the output should appear.
StudentID FinalAvg Grade
--------------------------
A00529154 63.8 D
A00656624 87.4 B
A02507691 68.2 D
A00612352 82.4 B
A04012435 77.8 C
A00654400 77.9 C
A00577109 92.8 A
A00580920 86.0 B
A04028610 90.0 A
A04063494 90.0 A