Question: Program must be written in C++: Write a program that reads test scores of students in a programming class from an input file, data.txt, and
Program must be written in C++:
Write a program that reads test scores of students in a programming class from an input file, data.txt, and calculates the minimum, maximum, average test score for each student as well as the overall average score for the class. Each row of the file contains student name (no spaces), and 3 scores for test 1, test 2, and test 3, respectively. Your main program should: open the file and check for successful open, then start reading one line at a time until EOF. For each line read, pass the grades for the three tests to a function called ProcessARow that calculates the minimum, maximum and average of the three grades. The results (minimum, maximum, and average) should be returned to the main program and the main program prints them on the screen in a table format. NOTE: minimum, maximum, average need to be sent by reference Call the function, ProcessOverall, that calculates the overall average of all grades. NOTE: parameters must be sent by value Sample input file: Bob 78 92 88 Sue 89 94 78 Fred 100 80 92 George 90 90 85 Mary 95 70 99 Jane 100 92 87 Sample output: Name Average Score ------------------------------ Bob 86.00 Sue 87.00 Fred 90.66 George 90.00 Mary 88.33 Jane 93.00 ------------------------------ Overall Average: 89.16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
