Question: In C++ Write a program that asks the user for a file name. Assume the file contains a series of numbers, each written on a

In C++

Write a program that asks the user for a file name. Assume the file contains a series of numbers, each written on a separate line. Your program should read how many numbers there are in the file and make that value the size of your array, create your own file, I will have my own to run on your program. The program should read the contents of the file into an array and then display the following data:

The lowest number in the array

The highest number in the array

The total of the numbers in the array

The average of the numbers in the array

In addition to your main function, your program should have five functions:

Function that reads the numbers from a file and stores them into an array

Function that finds the lowest value in the array and returns that value. There will be a size parameter which is the number of elements in the array.

Function that finds the highest value in the array and returns that value. There will be a size parameter which is the number of elements in the array.

Function that calculates and returns the sum of the values stored in the array.

Function that calculates and returns the average of the values stored in the array.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!