write a program to compute numeric grades for a course. The courserecords are in
ID: 3617386 • Letter: W
Question
write a program to compute numeric grades for a course. The courserecords are in a file that will serve as the input file. The inputfile is in exactly the following format: Each line contains astudent's last name, then on espace, then the student's first name,then one space, then ten quiz scores all on one line. The quizscores are whole numbers and are separated by one space. Yourprogram will take its input from this file and send its output to asecond file. The data in the output file will be the same as thedata in the input file except that there will be one additionalnumber ( of type double ) at the end of each line. This number willbe the average of the student's ten quiz scores. If this is beingdone as a class assignment, obtain the file names from yourinstructor. Use at least one function that has file streams as allor some of its arguments.Input file content:
test_ line_ 10 20 30 40 50 60 70 80 90 100
Price Betty 40 50 60 70 60 50 40 30 60 90
Goodman James 60 70 80 90 50 60 90 90 100 90
Smith Charles 70 80 90 60 70 60 80 90 90 90
Jones Warren 70 70 80 90 70 80 90 80 70 60
Explanation / Answer
please rate - thanks #include #include using namespace std; void calculate(ifstream&, ofstream&); int main() { ifstream in; ofstream out; in.open("input.txt"); //open file if(in.fail()) //is it ok? { coutfirst; while(in) {sum=0; in>>last; for(i=0;i>a[i]; sum+=a[i]; } outRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.