From d7b8febf01ae0fb34a42ca0e20bbed4320b4b49a Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Wed, 9 Apr 2014 10:30:04 -0500 Subject: [PATCH] Now calculates range. --- src/MMMCalc.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MMMCalc.java b/src/MMMCalc.java index 6ac0bd8..044b21f 100644 --- a/src/MMMCalc.java +++ b/src/MMMCalc.java @@ -43,6 +43,7 @@ public class MMMCalc { calcMean(); calcMedian(); calcMode(); + calcRange(); } } else { System.out.println("You did not mention any variables. Use the -h argument for help."); @@ -95,4 +96,13 @@ public class MMMCalc { System.out.println("Mode: " + mode + " (frequency: " + modeFreq + ")"); } + + private static void calcRange() { + // FIXME + int l = numArray.length -1; + float range = 0; + range = numArray[l] - numArray[0]; + + System.out.println("Range: " + range); + } }