Question: Write a program to analyze students scores. Each students ID and 4 original test scores are saved in the attached file student_ID_scores.txt. Assume there are

Write a program to analyze students scores. Each students ID and 4 original test scores are saved in the attached file student_ID_scores.txt. Assume there are exactly 15 students in the class. (C++)

CT1001 62 89 63 59 CT1002 99 91 95 86 CT1003 67 45 67 77 CT1004 61 78 90 73 CT1005 97 99 82 90 CT1006 90 96 81 92 CT1007 65 67 62 85 CT1008 78 80 79 90 CT1009 80 75 65 89 CT1010 87 98 90 92 CT1011 76 81 69 92 CT1012 100 95 86 95 CT1013 90 79 66 82 CT1014 80 68 71 66 CT1015 88 95 67 98 

The program first opens the file, reads students IDs and scores from the file and saves them in two arrays:

Create a one-dimensional string array IDs to store the students IDs.

Create a (parallel) two-dimensional int array scores to store students original test scores. This array has 5 columns, the original 4 test scores should be saved in the first 4 columns, and the last column will be used to save the average score after the calculation in next step.

The program then retrieves test scores from the array scores, calculates average score and determines the final letter grade based on the rules in the table below for each student. Assume average score is integer value.

average score = (score1 + score2 + score3 + score4) / 4

Average score

Letter grade

90 ~ 100

A

80 ~ 89

B

70 ~ 79

C

60 ~ 70

D

0 ~ 60

F

The average score should be saved back in the 5th column of scores array.

Create a new parallel one-dimensional char array grades to save each students letter grade.

Program also needs to find the number of A, number of B, number of C, number of D and number of F grade. As well as the highest, lowest and average score of the class.

Finally, program will display all of the original scores and all results on the computer screen using the format shown as the sample output below.

The program must contain at least the following functions:

(1) A function GetScores to read and store data into IDs and scores arrays.

(2) A function AnalyzeScores to calculate students average score, determine letter grade, get the number of A, B, C, D and F, find the highest, lowest and average score of the class.

(3) A function DisplayResults to display all of the results as shown in the sample output.

Sample output:

Write a program to analyze students scores. Each students ID and 4

The main driver function is provided, please follow the instructions and existing code to complete the definition of other functions:

#include

#include

#include

#include

using namespace std;

const int SIZE = 15;

const int COLUMN = 5;

void GetScores(ifstream& inf, string IDData[], double scoresData[][COLUMN]);

void AnalyzeScores(double scoresData[][COLUMN], char grade[], int gradeCount[], double stats[]);

void DisplayResults(string IDData[], double scoresData[][COLUMN], char grade[], int gradeCount[], double stats[]);

int main()

{

// define variables

string IDs[SIZE];

double scores[SIZE][COLUMN];

char grades[SIZE];

int gradeCount[5] = { 0, 0, 0, 0, 0 }; // number of A, B, C, D, and F grades

double stats[3] = { 0.0, 0.0, 0.0 }; // highest, lowest, and average grade

// get input file

ifstream inFile;

inFile.open("student_ID_scores.txt");

if (!inFile)

{

cout

cout

return 1;

}

// run analysis

GetScores(inFile, IDs, scores);

AnalyzeScores(scores, grades, gradeCount, stats);

DisplayResults(IDs, scores, grades, gradeCount, stats);

inFile.close();

//system("pause");

char exit;

cout

cin >> exit;

return 0;

}

GDADCABDBCACACCB a55-005555500550 r2?0507772750220 u82452991?19491? 696798687979778 e96?302509225268 T587 99898999869 2 4-0 948 e35702129509661? T6969886?6968676 asa I al eeu hehn thti e9-5896705815985 T894 99687989769 5 .inoo ABCDF r e r o orot oooooscs e297-70580760008 g g g g g T69669967887-988 s e tek tttttesa nnnnnhern eeeeegwea 1234567890-2345dddddi o u sssssssss 11111uuuuuhlas

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!