Question: Please Use C language to write this program. In the program, the users can input up to the maximum of 50 integer numbers. The program
Please Use C language to write this program. In the program, the users can input up to the maximum of 50 integer numbers. The program should calculate the median, mean, and standard deviation of the input data, and the sorted numbers. And then output the answer.
a. Please don't use global variables in the program and the main function should be the only function permitted to do output to the console.
b. Declare arrays you need in the main function and pass the arrays as needed into the functions described below.
c. The data collection loop must make the users do not enter more than 25 numbers, and it should also allow users to enter less than 25 numbers.
d. The program should check each entered value is between 0 to 25. Other values out of the range should be invalid.
e. The array and the data collected must be passed to a function called mean once the data is collected.
f. The mean function should loop through values and sum the values together. And the result should be the sum divided by the number of inputs entered. The result should return from mean function to main function.
g. After this, the main function should pass the array, and the number of inputs should be collected to the median function.
h. The median of some numbers means there are half numbers above it and half numbers below it. This median function needs to sort the original data.
i. Please use Bubble sorting as sorting procedure. And here is an example of Bubble sorting to sort for Y valid array:
for out = 0; out for in = 0; in if array[in]>array[in+1] swap(array[in], array[inner+1]); j. If the array has an odd number of elements, the median will be the value of the middle element(arraysize/2). If it has an even number, the median should be the average of the middle two elements(2 middle elements: arraysize/2 & (arraysize/2)-1). The median value should be returned by the median function. k. Then the main function should pass the array and collect the numbers to the standard deviation function(SN=SQRT[1/N(sum(xi-mean)^2)] for i=1,2,,N). l. The main routine must output the standard deviation value in an appropriate manner, and must output the sorted array with 20 numbers per line. Please use C language to write the program. Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
