Assignment 6 - Student Grades Using File I/O

due November 4th

The purpose of this assignment is to give you practice reading and writing text files, program planning and development.

This program consist of two parts:
1) reading and processing a student data file, and writing the results to a student report file
2) modifying part 1 to determine the number of each letter grade and writing that to the screen.
For this assignment, you will be reading an input file and writing out another file and writing to the console (screen).

Your program will be run using the referenced student data file.

Part 1 Detail

Read in the student data file, partially shown below. This 50 record file consists of a (8-digit numeric) student id, 11 assignment's points, midterm points, final points and lab exercise points. You must again follow the rules from assignment 4 to determine the letter grade. In this assignment, you will process 50 student grades. CodeLab points are not applicable for this assignment.  You will write the input student data and the results of the processing into a student report file that looks like the output shown below. In addition to the input student data, the report should contain the "total" of the assignment grades, the total and percent of all points achieved, and the letter grade.  You may assume that the input data file does not contain any errant data.

The Student Data Input File

00418467 13 20 19 20 19 18 19 20 20 11 19  47  82 35
98955447 11 15 20 19 16  7  4 19 20 18 18  34  86 48
00372859 19 16  4 20 19  2  6 17 19 12 17  50  39 38
40849954  8 19  2 20 16 19 18 20 20 19 15  42   0 39
90726270  7 15 19 20 15  5 19 19 20  9 19  44  82 34
49458909  2 20 12 19 17  1 14 19 20 14 19  50  43 39
02910836 19 15  0 20 19 17  4 16 19 20 16  34  95 38
12345678 20 18 20 16 20 20 20 16 20 19 20  48  95 49
28139514  5 19  3 20 17 19  0 20 20 19 16  40  32 41
66180580 16 20 19 20 16  4 19 19 20 13 19  47  91 33
42720055  3 20 10 19 15  6  2 19 20 10 20  47  55 36

...

The Student Report Output File

Student   -----   Assignment Grades  -----  Ass  Mid  Fin LEx Total  Pct Gr
--------  -- -- -- -- -- -- -- -- -- -- --  ---  ---  --- --- -----  --- --
00418467  13 20 19 20 19 18 19 20 20 11 19  187   47   82  35   351   88 B+
98955447  11 15 20 19 16  7  4 19 20 18 18  163   34   86  48   331   83 B
00372859  19 16  4 20 19  2  6 17 19 12 17  149   50   39  38   276   69 D+
40849954   8 19  2 20 16 19 18 20 20 19 15  174   42    0  39   255   64 D
90726270   7 15 19 20 15  5 19 19 20  9 19  162   44   82  34   322   81 B-
49458909   2 20 12 19 17  1 14 19 20 14 19  156   50   43  39   288   72 C
02910836  19 15  0 20 19 17  4 16 19 20 16  165   34   95  38   332   83 B
12345678  20 18 20 16 20 20 20 16 20 19 20  193   48   95  49   385   96 A
28139514   5 19  3 20 17 19  0 20 20 19 16  158   40   32  41   271   68 D+
66180580  16 20 19 20 16  4 19 19 20 13 19  181   47   91  33   352   88 B+
42720055   3 20 10 19 15  6  2 19 20 10 20  142   47   55  36   280   70 C-

...

Part 2 Detail

Write a summary of  the number of A's, B's, C's, D's and F's for the students. Your summary output should be written to the console (screen).


The number of A's = ??
The number of B's = ??
The number of C's = ??
The number of D's = ??
The number of F's = ??

Additional requirements

  1. All files must be checked for a successful open.
  2. Make sure you write the student id with a leading 0, if appropriate.
  3. Add headings to your output report file. They should be aligned and correctly identify the column data.
  4. Do not use global variables, except for constants, in your solution.