class NegativeTall { public static void main(String[] args) { int[] ints = {1, 4, 5, -2, -4, 6, 10, 3, -2}; int i; /* * A */ //Count the number of negative ints i = 0; int numNegative = 0; while (i < ints.length) { if (ints[i] < 0) numNegative += 1; i += 1; } System.out.println("Number of negative ints: "+numNegative); /* * B */ //Replace negative ints with their index i = 0; while (i < ints.length) { if (ints[i] < 0) ints[i] = i; i += 1; } /* * C */ //Output the ints in the array System.out.println("Elements in the array:"); i = 0; while (i < ints.length) { System.out.println(ints[i]); i += 1; } } }