Homework 11: Extra Credit 3: Median

Due: Tuesday 4/24 by 11:59pm Friday May 11, 2012


Objectives

More practice with arrays.

Assignment


This assignment is a continuation of Classwork 14. (Note: you must still submit Classwork 14 and Homework 11 separately.) For this assignment you will extend your program in Classwork 14 to calculate the median score. Recall that the median score is the value x such that half of the scores are less than or equal to x and half of the scores are greater than or equal to x. (Note: if there are an even number of values, then two values might be considered the median. Just report one of these two values, do not take the average.)

For example, the median of {1, 7, 2, 2, 4, 2, 9, 3, 7} is 3 because 4 values (1, 2, 2 and 2) are less than 3 and 4 values (7, 4, 9 and 7) are greater than 3.

Notes

What to submit

Use the script command to record yourself compiling your program and running your program on hw11test1.txt, hw11test2.txt and any other test file that you have created. Then submit your program and typescript file as usual:


submit cs104_chang hw11 median.c typescript