Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Student data should be stored in a struct variable of type StudentType , which h

ID: 3615658 • Letter: S

Question

Student data should be stored in a struct variable of typeStudentType, which had four components:studentFName and studentLName of typestring,

testScore of type int (testScore isbetween 0 and 100), and

grade of type char.

Suppose that the data has 20 students. Use an array of 20components of type studentType.

Program must contain at least the following functions:

A function to read the students data into the array

A function to assign the relevant grade to each student

A function to print the names of the students having the highesttest score.

Program must output each students name in this form: Last name,followed by a comma, followed by a space, followed by first name,and the name must be left justified. Moreover, other than declaringthe variables and opening the input and out files, the functionmain should only be a collection of function calls.

List of students and grades:
(18A.txt)

Bob Smith 87

Mike Christy 90

Steven Michaels 33

Michael John 78

Amy Clark 99

Nicole Hasty 91

Bob Robert 89

Chris Nash 77

Chris Thomas 67

Joe Tea 93

Bob Young 87

Mike Stevenson 95

Trent Fiore 70

Anthony Joe 82

Matt Coffee 90

Mark Tomlinson 89

Phil Rope 94

Mike Stopper 88

Mark Robinson 78

Betty Lee 77

# include<iostream>
# include <string>
# include <fstream>

using namespacestd;

const int ARRAY_SIZE =20;

structstudentType

{
      
string studentFName, studentLName;
char grade;
char fileName(18A.txt)
int testScore;
}

voidopenfile(ifstream& infile)
void readData (ifstream& inFile, int array[],StudentType);
void grade (grade, studentType);
void getData (int array[],int arrayLength, string,studenttype);
int highScore( int testScore, 0-100, student)

int main ()
{

ifstream infile;
ofstream outfile;

string inputFile;
string outputFile;


infile.open (18A.txt)

cout << " Highest score in the class is:"
      cin >>highestScore;

Here is what I have so far but not really sure what direction tohead in? Any help would be great! Thanks.

Explanation / Answer

please rate - thanks #include #include #include #include using namespace std; const int ARRAY_SIZE = 20; struct studentType {     string studentFName, studentLName; char grade; int testScore; }students[20]; bool openinfile(ifstream& inFile,char filename[] ); void openoutfile(ofstream& outFile,char filename[]); int readData(ifstream& inFile, studentType students[]); void getgrade( studentType students[],int n); void printData(ofstream& outFile, studentType students[],intn); void highScore( ofstream& outFile, studentTypestudents[],int n); int main () {bool good; int n; ifstream infile; ofstream outfile; good=openinfile(infile,"18A.txt"); if(good) {openoutfile(outfile,"output.txt"); n=readData ( infile, students); getgrade(students,n); printData(outfile,students,n); highScore(outfile,students,n); outfile.close(); infile.close(); } system("pause"); return 0; } void openoutfile(ofstream& outFile,char filename[]) {outFile.open(filename); }   bool openinfile(ifstream& infile,charfilename[])    { infile.open (filename); if(infile.fail())                   { coutstudents[n].studentFName>>students[n].studentLName>>students[n].testScore; while(inFile) {n++; inFile>>students[n].studentFName>>students[n].studentLName>>students[n].testScore; } return n; } void getgrade( studentType students[],int n) {int i; for(i=0;i