Question: Program #6 Arrays You are to write a program that will calculate the grade averages for students in a course. You will read the data
Program #6 Arrays
You are to write a program that will calculate the grade averages for students in a course. You will read the data from a file called studentScores.dat. Assume a maximum of 100 students. Copy these files to your csc135 directory from the following public directory:
studentScores.dat cat
172651212 89 94 85 50 45 48 40 50 44 85
832198439 72 85 80 35 42 40 48 42 45 81
823184903 95 90 92 50 48 48 45 42 50 89
481284930 68 75 72 20 30 35 32 20 15 73
810849390 50 60 67 10 0 20 15 30 25 65
831083910 85 89 88 45 48 42 50 46 40 86
819412122 90 98 94 50 49 48 50 50 45 94
483843110 88 96 92 42 48 45 43 44 47 90
123123413 90 85 92 45 48 35 50 48 45 88
311020394 76 68 71 30 32 28 35 38 36 77
123434390 95 88 92 48 43 50 47 42 40 91
092348348 62 55 71 25 0 0 30 35 34 68
145848348 89 90 92 48 50 49 50 45 44 90
673248348 85 88 83 40 43 38 44 45 44 87
099288348 92 95 87 45 50 50 48 47 49 93
The first file is the data file. The second file is a working executable that you can run as an example of how the program should work.
The data file layout is:
SID test1 test2 test3 prog1 prog2 prog3 prog4 prog5 prog6 final
Note that the tests and final are each worth 100 points while the programs are each worth 50 points.
What you should do:
First, name your program: arrays.cpp
In the program, read the data from the file, line by line, for each student. For each line read, store the students id number (SID) into an array, compute that students average (see below) and store the average in a second, parallel, array. Then, using the computed average, determine the appropriate letter grade and store this into a third, again parallel, array. Continue in this manner until all lines have been processed and the data has been stored in the three parallel arrays. This portion of the program may be done in main(),
The program should output each student's SID number, course average, and grade for the course.
It should be neatly formatted with a proper header and with uniform precision for the averages. Columns should line up and be readable and consistent. This must be done in a function.
You will then compute the number of As, Bs, Cs. Ds, and Fs for the course and display this information. This must also be done in a function.
Finally, compute and display the overall average for the entire class. This must be done in a function as well, for a total of, at least, three functions.
See the next page for directions on how to compute the average and determine letter grades.
Computation of average and letter grade determination:
The three tests will be 50% of the course average, the six programs will be 25% of the course average and the final will be 25% of the course average.
Use the following scale to find the grade for the course:
> 89.5
> 79.5 and <= 89.5
> 69.5 and <= 79.5 D > 59.5 and <= 69.5
F <= 59.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
