Trying to make a rainfall calculator using Java, but implementing the use of methods and arrays, what am I missing?
public static void showTotal(int[] amountPerMonth)
{
int total =0;
int[] rainfall = new int[12];
for (int i=0; i<12; i=i+1)
{
rainfall[i] = GUI.getInt("Enter rainfall during month " + i);
total = rainfall[i] + total;
}
System.out.print(total);
}
Posted Dec 2, 2015, 10:37 PM UTC
16