Assignment 1 - Student Grades Using File I/O and Arrays

due January 16th

The purpose of this assignment is to review the use of one-dimenisonal arrays, reading and writing text files, writing functions, and 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 calculate some statistics and writing them to another file.
For this assignment, you will be reading one input file and writing out two other files.

You only need to email the source code.  It should generate the necessary output files.

Part 1 Detail

Read in the student data file, partially shown below. This 50 record file consists of a (8-digit numeric) student id, lab exercise points, 10 assignment's points, midterm points, final points, and CodeLab points. You must follow the syllabus specifications for the determination of the letter grades. You will write the input student data and the results of the processing into a student report file that looks "just 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    (This was updated 1/10/18)

77997913 38 19 16 16 16 20 20 16 20 16 16 56  60  3
87969978 30 20 11 14 19 11 13 14 8 19 10 60 77 7
81564051 21 14 12 11 18 9 17 11 15 9 20 76 90 6
25744204 37 18 16 19 14 16 13 16 15 17 20 68 74 8
53057551 24 9 12 15 10 15 11 20 16 17 20 22 62 8
49778442 31 9 8 6 7 20 10 16 7 16 5 79 45 10
01234567 17 19 18 15 19 14 14 17 15 16 20 37 65 5
34664035 38 20 7 15 20 17 15 16 16 16 5 34 83 9
...

The Student Report Output File

   (This was updated 1/10/18)

Stdnt Id  Ex  ------- Assignments ---------  Tot  Mi  Fin  CL  Pts  Pct  Gr
-------- -- ----------------------------- --- -- --- -- --- --- --
77997913 38 19 16 16 16 20 20 16 20 16 16 159 56 60 3 316 79 C+
87969978 30 20 11 14 19 11 13 14 8 19 10 131 60 77 7 305 76 C
81564051 21 14 12 11 18 9 17 11 15 9 20 127 76 90 6 320 80 B-
25744204 37 18 16 19 14 16 13 16 15 17 20 151 68 74 8 338 85 B
53057551 24 9 12 15 10 15 11 20 16 17 20 136 22 62 8 252 63 D
49778442 31 9 8 6 7 20 10 16 7 16 5 99 79 45 10 264 66 D
01234567 17 19 18 15 19 14 14 17 15 16 20 153 37 65 5 277 69 D+
34664035 38 20 7 15 20 17 15 16 16 16 5 142 34 83 9 306 77 C
...

Part 2 Detail

Write a summary report file that contains the maximum points for all students. Also, display the number of A's, B's, C's, D's and F's for the students. Your summary output file should look something like this:

Number of A's = ??
Number of B's = ??
Number of C's = ??
Number of D's = ??
Number of F's = ??

Maximum points = ??? <- This is the highest number of points achieved by any student

Program requirements

  1. You must use at least 1 one-dimension array - for the student's 10 assignment grades.  Do not use 2 dimensional arrays - this will be covered in the another assignment.
  2. Your solution must include at least 3 functions, counting the main() function.  One function must include an array argument and at least one must include a "pass by reference".  Place the function definitions below main() and function prototypes above main().
  3. All files must be checked for a successful open.
  4. Make sure you write the student id with a leading 0, if appropriate (i.e. the 7th id).
  5. The percent of total points must be rounded to the nearest integer.  For example, 377 points is 94%, 378 points is 95% and 379 points is 95%.
  6. The letter grade is determined by the "integer" percent.  For example, 350 points becomes 88% becomes B+.
  7. Add headings to your output report file. They should be aligned and correctly identify the column data.
  8. Email your source code.  Your code will be checked for the output files.
Hints