Here's the prompt: Return an array of 13 doubles with the sines of the integers -6 to 6 in order.
I keep getting an ArrayIndexOutOfBoundsException: 13 (line:4) error. How do I fix it?
Here's my code:
public double[] thirteenSines(){
double[] arr = new double [13];
for(int i = -6; i < arr.length; i++)
arr[i + 6] = Math.sin(i);
return arr;
}
Any help is greatly appreciated!