Hi so im having a small problem that i cant figure out and its that everytime i try to run my code im getting an ArrayIndexOutOFBoundsException around lines 60 and 61 and im not sure how to fix this can anyone help me with this?
The basic format for iterating an array with a for loop is:-
for (int i = 0; i < myArray.length; i++) ... That format will always visit every element of the array missing none out and will never overrun the bounds of the array however large or small it is. You should always start from that format and consider changes; if you use both myArray[i] and myArray[i + 1] you will need a change.
Now have a look at your lines 60 and 61 and see how you have written the for loops.
I noticed the formatting of your for loop on line 58
The maximum index for the array is 14 but the loop will set the count variable to 15 because of
I think if you get rid of the +1 you will get rid of your ArrayOutOfBoundsException because the loop will then run and terminate before count is set to 15.