Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this problem, you will write a program that computes the median of a set of numbers ( median 1 , cc ) . The
In this problem, you will write a program that computes the median of a set of numbers mediancc The median of a list of number is computed by first sorting the list in ascending order, and choosing the number in the middle. If there is an even number of numbers, the median is the average of the two numbers in the middle.
For example, the median of the list
is while the median of the list
is
a Write the function:
void sort int int ;
which sorts the array of elements in ascending order. You may use any sorting algorithm you learned from CPSC
b Write the function:
double median int ;
which computes the median of the array of elements. It is acceptable if the function rearranges the elements of
c Write the main program which asks the user to enter allocates an array of elements, and displays the median. The program should repeat as long as When exit the program. Be sure that there is no memory leak.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started