Hello everyone! I have yet another question haha. Arrays are still hard for me to grasp at the moment.
So, I'm trying to write a code that uses arrays inside methods. getTotal, getAverage, getHighest, and getLowest for test scores.
Everything was going well until I tried to create the gethighest method. I'm getting this error:
91.0Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at Grade.getHighest(Grade.java:44)
at Grade.main(Grade.java:16)
Here's the code so far:
I've tried fixing it with no luck, I don't even know why it thinks that "index" is an int, even when I declare it as a double. Any help will be much appreciated! Thanks!
So, I'm trying to write a code that uses arrays inside methods. getTotal, getAverage, getHighest, and getLowest for test scores.
Everything was going well until I tried to create the gethighest method. I'm getting this error:
91.0Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at Grade.getHighest(Grade.java:44)
at Grade.main(Grade.java:16)
Here's the code so far:
I've tried fixing it with no luck, I don't even know why it thinks that "index" is an int, even when I declare it as a double. Any help will be much appreciated! Thanks!