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.
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-59488.pdf
Comments
Leave a comment