// Mean Median Mode

/*RULES:
  Function takes number array as parameter and it will return an object that has three properties:
    Mean - The Average of all numbers
    Median - The middle number
    Mode - The number most seen

  This algorithm should have 4 separate functions:
    getMean(arr)
    getMedian(arr)
    getMode(arr)
    meanMedianMode(arr)
      This last one calls all of the other functions
      Returns an object that has the mean, median, and mode
*/

/*PSEUDOCODE

  This seems pretty straightforward, but here's the plan:
  1) Make each individual function first
    1a) Mean: Sum all elements, divide by length of array
    1b) Median: Sort all elements numerically, pick the one in the middle
    1c) Mode: Create an object with all numbers in array. Tally up frequency, return number seen the most.
  2) meanMedianMode
    2a) Call all the functions and put them in an object.
    2b) Return object
*/

function getMean(arr){
  var sum = 0;

  for (var i = 0; i < arr.length; i++){
    sum += arr[i];
  }
  return (sum/(arr.length))
}

function getMedian(arr){
  
}

function getMode(arr){
  
}

function meanMedianMode(arr){
  
}
@@ -1077,32 +1077,384 @@
 tMedian(arr)%7B%0A  
+var length = arr.length;%0A  var middlePoint = (length / 2)%0A  arr = arr.sort(function(a, b)%7Breturn a - b%7D);%0A%0A  if (Number.isInteger(middlePoint))%7B%0A    if (arr%5BmiddlePoint - 1%5D == arr%5BmiddlePoint%5D)%7B%0A      return arr%5BmiddlePoint%5D%0A    %7D%0A    return ((arr%5BmiddlePoint - 1%5D + arr%5BmiddlePoint%5D) / 2);%0A  %7D else %7B%0A    return arr%5BNumber.parseInt(middlePoint)%5D;%0A  %7D
 %0A%7D%0A%0Afunction get

Complete functionality for median