Question: C++ Write a program that reads student names from a file followed by their test scores. The program should then output each student's name followed
C++
Write a program that reads student names from a file followed by their test scores. The program should then output each student's name followed by the test score and the relevant grade. It should also print the highest test score and the name of students having the highest test scores.
Write a program that reads student names from a file followed by their test scores. The program should then output each students name followed by the test score and the relevant grade. It should also print the highest test score and the name of students having the highest test scores. Specifically, write a code to: Read from the file (inData.txt) and store in a struct variable of type studentType, which has four components: studentFName, and studentLName of type string, testScore of type int (between the range of 0 and 100), and grade of type char. Suppose the class has 20 students. Use any array of 20 components of type studenetType. Your program should contain the definition of the following functions: 1.A function to read the students data into the array void getData(ifstream& inFile, studentType sList[], int listSize); 2.A function to assign the relevant grade to each student void calculateGrade(studentType sList[], int listSize); 3.A function to find the highest test score int highestScore(const studentType sList[], int listSize); 4.A function to print the name of the students having the highest test score. void printResult(const studentType sList[], int listSize);
student.dat
Joe Doe 90 Susan F. Smith 95.5 Sam Grover 78 Diane C. Phelps 100 John Franklin 85 Derrick Myers 59
I already have code, but I can't figure out how to allow the middle initial with the period without it ending the code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
