#include #include #include #include //Precondition all 4 grades and student numbers have been read from file //it calculates the max score and returns integer to max main int computing_max (int sc1, int sc2, int sc3, int sc4) { int max=sc1; if(sc2>max) max=sc2; if (sc3>max) max=sc3; if (sc4>max) max=sc4; return max; } //Precondition all 4 grades and student number have been read from file //it calculates the min score and returns integer min to main int computing_min (int sc1, int sc2, int sc3, int sc4) { int min = sc1; if (sc2>filein; cout<<"Enter filename to save information to......."; cin>>fileout; ifstream infile; ofstream outfile; infile.open(filein); if (infile.fail()) { cout<<"Opening file failed.. Now exiting..."; exit(1); } cout<<"Opening "<>student_number>>gr1>>gr2>>gr3>>gr4; while (!infile.eof()) { cout<<"Calculating student "<temp) { best=student_number; temp=average; } outfile<>student_number>>gr1>>gr2>>gr3>>gr4; } outfile<<"The best student is student number "<>student_number>>gr1>>gr2>>gr3>>gr4; while (!infile.eof()) { outfile<>student_number>>gr1>>gr2>>gr3>>gr4; } infile.close(); outfile.close(); cout<<"Done!"; return 0; }