Write a program to compute the arithmetic mean (average), median, and mock- for up to 50 test scores. The data are contained in a text file. The program will also print a histogram of the scores.
The program should start with a function to read the data file and fill the array. Note that there may he fewer than 50 scores. This will require that the read ( unction return the index for the last element in the array.
Io determine the average, write a function similar to Program 8-4. To determine the median, you must first sort the array. The median is the score in the middle of the range. This can be determined by selecting the score at last / 2 if last is an even index and by averaging the scores at the floor and ceiling of last / 2 if last is odd. The mode is the score that occurs the most often. It can be determined as a byproduct of building the histogram.
The post Write a program to compute the arithmetic mean appeared first on Assignment Freelancers.