Question: This assignment is similar to the assignment #6 with some modifications. Instead of calculating average, minimum, and maximum in the main) function, you need write

This assignment is similar to the assignment #6 with some modifications. Instead of calculating average, minimum, and maximum in the main) function, you need write three separate functions to calculate them. The prototypes of the three function are as follows. int calc min(string file name, int total num); // returns min of integers in file name int calc max(string file name, int total num); // returns max of integers in file name nt calc avg(String file name, int total num); // returns average of integers in file name The parameter file name is the name of the file that contains the integers. The total num contains the total number of integers in the file. In the main() function, prompt the user to input both the file name containing the integers, and the total number of integers in the file. Then call the three functions (with appropriate arguments) to calculate average, min, and max and output the value returned by the functions To open the file, use infile.open(file _name.c _str0) where infile is an object of type ifstream Please submit your source code to eLearning
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
