Topical Information

This lab will help you practice with vectors and libraries.

Program Information

Write a program to find the median of the user's data. The median is defined as the middle number in an ordered sequence. If the sequence has an even number of values, the median is the average of the two middle numbers.

Place your median function in a library for statistics support (stathelp?).

Your driver (to test your median function) should fill a vector, retrieve the median, report it, and ask if the user wants to go again. For the filling, just read values from the user until a non-numeric value is entered.

Thought Provoking Questions

  1. How many values can your program handle?

  2. Does your program have the user enter ordered data or did you ensure it was ordered with a sort? (Hint: which way do you think is worth full credit?)

  3. In a list of n data items, what is the value of the middle item for odd n? What if n is even?

This assignment is (Level 3).

Options