LAB5: Arrays

Due: at 9:30 am on Thursday, 9/26/02.

Write a C++ program which does the following:

    Read up to 10 non-negative numbers (integers) and store in an array
        repeat
            Menu:
            1. Find the maximum
            2. Find the minimum
            3. Find the average
            4. Show how much each element differs from the average
            5. Sort the list in ascending order
            6. Sort the list in descending order
            7. Find the median (middle number)
            8. Search for a particular element in the array
            9. Quit
        until user quits

Note: For option number 8, get the number to be searched from the user and  give an appropriate response depending on the result. If the element searched is  found in the array,  give the location of it in the array. If not, say it is not found.

Median of a list of elements is the middle element when the list is sorted. When there are an even number of entries it is the average of the 2 numbers in the middle.
For example, if the list is  1, 3, 5, 7, 9 then median is 5.
If the list is 2, 4, 6, 8 then the median is average of 4 and 6 which is 5.
So to be able to find the median, you need to sort the array first.