Now calculates range.
This commit is contained in:
		@@ -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);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user