// Test Program #7 - // ArrayMax.txt - Find the max value in an array. // Try this one AFTER you get expressions and objects working, // (because those are more important than arrays). public class ArrayMax { public ArrayMax() { super(); } public static void main(){ int i, largest; // current largest number JFSystem sys; int[] intArray; // Array of integers sys = new JFSystem(); intArray = new int[6]; // Initialize Array intArray[0] = 77; intArray[1] = 8; intArray[2] = 99; intArray[3] = -555; intArray[4] = 13; intArray[5] = 2; // Find max in the array. i = 1; largest = intArray[0]; while (i != 6) { if (intArray[i] > largest ) largest = intArray[i]; i = i+1; } // Print the largest number in the array. sys.put(largest); } }