Project 20: Median of Data

The median of a dataset is usually referred to as the middle number.

2, 5, 8, 11, 19

In the example above, 8 is the median.

However, if there is not one single middle number, the median is the mean (average) of the two middle numbers.

2,5,8,11,19,25

In the example above, the median is 9.5 (the average of 8 and 11)

Project 20: The variable 'x' has been initialized (an array of numbers in ascending order - sorted from least to greatest).  There is also a working method called roundDown(n) that returns the value of n rounded down the integer smaller than or equal to itself.

roundDown(3.8) returns 3

roundDown(4.1) returns 4

roundDown(5) returns 5

Task: Initialize the value of 'median' that represents the median of the data.

**If your code works for 5 test cases in a row, you can enter your e-mail address.

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0