diff --git a/src/MMMCalc.java b/src/MMMCalc.java index f12d71e..e789baa 100644 --- a/src/MMMCalc.java +++ b/src/MMMCalc.java @@ -17,6 +17,7 @@ public class MMMCalc { private static float mode = 0; private static float range = 0; private static float stdDev = 0; + private static float varience = 0; public static void main(String[] args) { System.out.println("Welcome to MMMCalc v0.2, a simple tool for basic statistics calculations.\n" + @@ -42,6 +43,7 @@ public class MMMCalc { calcMode(); calcRange(); calcStdDev(); + calcVarience(); } else { numArray = new float[args.length]; @@ -55,6 +57,7 @@ public class MMMCalc { calcMode(); calcRange(); calcStdDev(); + calcVarience(); } } else { System.out.println("You did not mention any variables. Use the -h argument for help."); @@ -141,4 +144,11 @@ public class MMMCalc { System.out.println("Standard Deviation: " + stdDev); } + + private static void calcVarience() { + // NOTE: I'm doing it this way so I don't have to convert the variables to doubles and lose precision. + varience = stdDev * stdDev; + + System.out.println("Varience: " + varience); + } }