public static double ComputeMedian() { Arrays.sort(ScoreList); //Sort the list int middle = ScoreList.length / 2; // middle number if (ScoreList.length % 2 == 1) { // There is an odd number of test scores so return the one middle number return ScoreList[middle]; } else { // There is an even number of test scores so return the average of the middle two return (ScoreList[middle - 1] + ScoreList[middle]) / 2.0; } }

public static int ComputeMode() { // Create array of tallies, all initialized to zero int[] tally = new int[101]; for (int i = 0; i < tally.length; i++) { tally[i] = 0; } // For each array entry, increment the corresponding tally for (int i = 0; i < ScoreList.length; i++) { int value = ScoreList[i]; tally[value]++; } // Find the index of the largest tally int maxIndex = 0; for (int i = 1; i < tally.length; i++) { if (tally[i] > tally[maxIndex]) { maxIndex = i; } } return maxIndex; }

On a slightly less important side note, does anybody have any idea why this method to fill the list with random numbers would be not working? It doesn't add any numbers to the list.

public static void Random(int amount) { Random gen = new Random(); for (int i = 0; i < amount + 1; i++) { ScoreList[i] = (int)gen.nextInt(101); } }