Now calculates range.

This commit is contained in:
Deathsbreed 2014-04-09 10:30:04 -05:00
parent 64174d5c8e
commit d7b8febf01

View File

@ -43,6 +43,7 @@ public class MMMCalc {
calcMean(); calcMean();
calcMedian(); calcMedian();
calcMode(); calcMode();
calcRange();
} }
} else { } else {
System.out.println("You did not mention any variables. Use the -h argument for help."); 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 + ")"); 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);
}
} }