- Formulate the steps of identifying the median from five unique numbers and visualize them in flow chart.
- Develop an application that shows the median after getting five unique numbers from users.
- Extend the feature for allowing six unique numbers input and computing the median.
Example:
Input: 5 4 2 1 10
Output: Median = 4
I found this question in a Problem Solving with C++ by Walter Savitch but I couldn’t solve it. Can anyone explain it to me?
Trying to give homework-friendly advice:
1) Make sure you know how to get a Median. Can you, in your head or on paper, figure it out? Now, how do you write a program to do this for you? Make a flowchart.
2) Write the program to do it. A user gives your program 5 numbers, your program gives the median as an answer.
3) Make the program better. An even amount of numbers changes the method to get a median. Change your program so that it will allow 6 numbers.
3b) Make your program accept any amount of numbers. (I added this, not in your post or in your book but should be super-easy to do if you’ve already done 2 and 3).