Hey guys -
Alright, so for this assignment, we're "simulating" entering high temperature values into an array. The array is of size 32, and each index in the array corresponds to the day (hence why the a[0] is an invalid temperature).
Here's the code.
public static void loadManuel(int[] a) { int length = a.length; a[0] = 2043; for (int i = 1; i < length; i++) { System.out.print(i + " - "); a[i] = scanner.nextInt(); } }
This code will work just fine, but sometimes when we're entering the temperature values we're supposed to "miss a day". What I'm wondering is, how do I make the code keep going even if there isn't data entered for that particular index?
Thanks