Here’s what I just tried. The return statements are just my idea of what I wish were possible. Everything I’ve seen from googling says to use an array or some other means that is sort of beyond me at this point. Is there not a simpler way?
public double getRainAt(int e) {
double[] thisYear = {1.6, 2.1, 1.7, 3.5, 2.6, 3.7, 3.9, 2.6, 2.9, 4.3, 2.4, 3.7};
double high = thisYear[0];
double low = thisYear[0];
for (int i = 0; i < thisYear.length; i++) {
if (thisYear[i] > high) {
high = thisYear[i];
}
if (thisYear[i] <= low) {
low = thisYear[i];
}
}
return high,return low;
}