Write a programs to compute numeric grades for a course. Thecourse records are i
ID: 3618537 • Letter: W
Question
Write a programs to compute numeric grades for a course. Thecourse records are in the file that will serve as the input file.The input file is in exactly the following format: Each linecontains a student's last name, then one space, then student'sfirst name, then one space, then ten quiz scores all on one line.The quiz scores are whole numbers and are separated by one space.Your program will take its input from this file and send its outputto a second file. The data in the output file will be the same asthe data 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 if the student's ten quiz scores.I am having major problems with appending the data after each line.I can get one line read and the quizzes averaged but i can get itto work for more than one line of data.
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
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.