Array problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Array problem

The mean of a list of numbers is its arithmetic average. The median of a list is its middle value when the values are placed in order. For example, if an ordered list contains 1, 2, 3, 4, 5, 6, 10, 11, and 12, then the mean is 6, and their median is 5. Write an application that has the following functions : A. getInput continues to take a non zero number as an input and stores in an array of 20 elements.It will stop taking input if the array is completely filled or the user has entered 0. B. getTotal Returns the total element in the array C. getMean find the mean of the array D. getMedian finds the median of the array If the list has an even number of values, the median is the numeric average of the values in the two middle positions.

3rd Apr 2021, 6:02 AM
Arqum Farooq
Arqum Farooq - avatar
1 Answer