Homework 5

2010_F18/wk5/hw5.cpp

The purpose of this assignment is to read in student testscore data and generate a grade report file. The program will open the input file and process the student's id number followed by three test scores. Of the three test scores, the program will calculate the average of that student's test scores, then output the student's id, the three test scores, the average, and corresponding letter grade. The program will also calculate each test average, the overall average for the class, and output the value and corresponding letter grade for the class average.

Use the studentInput file for the input file. The format of this file is strict and dependent for the algorithm of how the program will process the input file. The input file's fomat is: studentId, test1, test2, test3. The outputed grade report file should be in the following format: studentId, test1, test2, test3, average (up to 1 decimal place), and letter grade. At the end of the output grade report file, show the class average for each test, overall test average, and corresponding letter grade to the class's overall test average. Have your output identical to the following output (use the iomanip setw(n) function to separate each colm value).

"gradeReport.txt"

Student Id      T1      T2      T3      Avg     Grade
1423333         99      88      94      93.7    A
3388822         78      79      83      80.0    B
1122333         92      85      87      88.0    B
8883231         74      67      82      74.3    C
4535328         92      81      77      83.3    B
3245985         68      76      88      77.3    C
9837452         84      86      78      82.7    B
2938559         99      96      94      96.3    A
5982358         89      83      93      88.3    B
2454959         34      58      67      53.0    F
9287500         88      85      96      89.7    B
9287352         66      55      44      55.0    F
2399943         0       50      100     50.0    F
5965672         74      93      94      87.0    B
1212121         100     100     100     100.0   A
9898989         88      90      94      90.7    A

--------------------------------------------------
class avg:      76.6    79.5    85.7    80.6    B