### i/o array problem

The program I am trying to get to work takes in a string student ID. 2 double test scores (max score of 200) and 5 double home work scores(max of 265) from a text file. It adds the scores up for test and homework separately then determines an average for them both separately. Then determines a final grade based on the tests counting for 60% of the total grade and the homework is the other 40%.

The problem is the scores are not calculating correctly from the first one on. The math works on paper but not in the program. And after each calculation the previous wrong score adds to the next students data. I think I need to add another loop but I am not sure? Any help would be greatly appreciated!!!!!!

input from the file prg5Data.txt

1
123456789 77.2 88.3 22 28 35 45 33 35 40
2
234567890 97.5 90 25 30 38 48 34 35 50
3
345678901 82.4 77.5 22.5 27 35.5 44 35 33 48

The first calculations are wrong, and it continues summing scores. What the correct score should be is in().

STUDENT ID / HW AVG / TEST AVG / FINAL SCORE / GRADE

123456789 / 98.1(89.8) / 80.0(82.8) / 87.2(85.6) / B
234567890 / 196.2 / 159.9 / 174.4 / A
345678901 / 294.3 / 239.9 /261.6 / A

Number of A's: 2
Number of B's: 1