The problem is to read student names and marks from a file, grade them and display the details (names and grades) on screen together with the highest score.
Method
Setup a class to store a student. The data is to include a first name, last name, tests core(whole number) and a grade (A..F). The class should include functions to read a student name and score from a file, to determine the grade from the score and to display that student’s details on screen. You may require other functions, that is for you to decide.
The main program should contain an array of student objects which are used in conjunction with the file to load all students’ results. Your program should handle up to 20 student’s results.
I cant attach the file "students.txt" so I have to post under this.
In this exercise it is expected you will require at least two non-class functions to calculate the highest score and to display all the results. The grades are to be awarded as follows:90 and over A, 80-89 B, 70-79 C, 60-69 D, less than 60 F.
Duckey Donald 85
Goof Goofy 89
Brave Balto 93
Snow Smitn 93
Alice Wonderful 89
Samina Akthar 85
Simba Green 95
Donald Egger 90
Brown Deer 86
Johny Jackson 95
Greg Gupta 75
Samuel Happy 80
Danny Arora 80
Sleepy June 70
Amy Cheng 83
Shelly Malik 95
Chelsea Tomek 95
Angela Clodfelter 95
Allison Nields 95
Lance Norman 88
//What varibles will you need?
//An int to hold test scores
//A string to hold the names of each student
//EX:
//int Grade
//std::string Name[2] - For first and last name
void student::SetArr(/*What will you need to put in here?*/)
{
//ifstream Obj("File.txt")
for(int i = 0;i<ArSize;i++) //ArSize is a constant you defined in the student class
//Read file into array
}
void student::CalculateScores(/*Parameters here*/)
{
//if(code here)
}
void student::DisplayResults(/*Paramters*/)
{
//DISPLAY
}
This is a hollow shell of how it might be done. Im going to go ahead and code it then come back and fix this.