My question is two-fold.
I have an array:
double [] temperature = {60.9, 62.6, 67.4, 71.5, 77.1, 81.2, 82.4, 82.5, 81.1, 75.3, 68.8, 63.0};
When I try to convert these Fahrenheit values to Celsius or Kelvin using:
for(int index = 0; index <= temperature.length; index++) {
temperature[index] = temperature[index] * tempConverter;
averageTemp += temperature[index];
}
I get an ArrayIndexOutOfBoundsException on temperature[index = temperature[index] * tempConverter;
- Why do I get this error?
- How do I fix this and reassign my values?