Question: Write a program that reads data from file numbers.txt and process it. The file contains a series of numbers, each written on a separate line.

Write a program that reads data from file numbers.txt and process it. The file contains a series of numbers, each written on a separate line. The program should read the contents of the file into an array and then display the lowest, highest, total, and average of the numbers in the array. The program should have the following functions:

readNumbers. This function reads numbers from file and stores them in the array.

getLowest. This function finds the lowest value in the array and returns that value.

getHighest. This function finds the highest value in the array and returns that value.

getSum. This function calculates and returns the sum of the values in the array.

getAverage. This function calculates and returns the average of the values 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!