Assignment 9 - Student Grades Using Arrays

due Monday, November 25th

The purpose of this assignment is to give you practice using arrays.

This assignment is a repeat of Part 1 of Assignment 7.  You will again be processing a student data file.  This time, you will storage all of the student data in one 20 element int array.  You will again read in the same student data file that you used in assignment 7, but this time you'll store that data in 15 elements of the array.  You will use the other 5 elements to store the calculated values. 

input file

Requirements

  1. Process one student record at a time from input file.
  2. Store all student data in one 20-element int array.  Store the following data items in the array:
  3. Your solution must include at least 3 functions in addition to main().  One or more of those function must have an array argument.  One or more of those functions must be called using a single element of the array.
  4. The program output should be written to a file just like assignment 7, and follow the same rules for determining points, percent, and grades.
Student   -----   Assignment Grades  -----  Ass  Mid  Fin LEx Total  Pct Gr
--------  -- -- -- -- -- -- -- -- -- -- --  ---  ---  --- --- -----  --- --
40680213   8 19 19 20 18 19 19 19 20  3 19  180   40   48  32   300   75 C
70750273   4 18  7 19 18  9 18 19 20  6 20  154   41    7  47   249   62 D
36331632  19 20 11 20 19 17  6 18 19 12 20  175   34   62  48   319   80 B-
70671155   8 19  7 20 18 19 20 20 20 19 20  183   40   86  29   338   85 B
69730920  15 19 19 20 17 12 19 19 20  4 19  179   38   11  47   275   69 D+
15535274   5 17  4 19 20 10  9 19 20 16 18  153   50   81  40   324   81 B-
76397884  19 20 19 20 19  5 19 19 19  8 20  182   44   60  40   326   82 B
90034920   4 19 14 20 19 19 11 17 20 19 17  175   33    8  44   260   65 D
07065286   7 20 19 20 17  7 19 17 20 19 19  177   38   14  42   271   68 D+
21869937  12 20  9 19 17  1  7 19 20 15 17  155   35   69  48   307   77 C
14733180  19 19  2 20 19 17 13 20 19 11 20  177   48   22  29   276   69 D+
01638880   1 19  8 20 18 19  5 20 20 19 17  165   33   42  37   277   69 D+

...

Additional requirements

  1. All files must be checked for a successful open. They should also be closed when you are finished with them.
  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.
  5. Place your function definitions below main() and their prototypes above main().
  6. Make sure you handle the EOF problem.  Test your code with and without a newline at the end of the file.