import java.util.Arrays; import java.util.Random; public class Debugging { public static int computeSum( int arrayOfIntegers[]){ int sum = 0; int i = 0; while(i < arrayOfIntegers.length-1 );{ sum += arrayOfIntegers[++i]; } return sum; } public static double computeAverage( int arrayOfIntegers[]){ double sum = computeSum(arrayOfIntegers); return sum / arrayOfIntegers.length; } public static void populateArray(int[] array){ Random randomGen = new Random(); for( int i = 0; i <= array.length; ++i ){ array[i] = randomGen.nextInt() % 100; } } public static void main(String[] args) { int arrayInts[] = new int[4]; populateArray( arrayInts ); double average = computeAverage(arrayInts); System.out.println(average); System.out.println(Arrays.toString(arrayInts)); } }