The index used with the array at line 7 is past the end of the array. The array appears to be empty because there is no first element (index = 0)
The code should use an if statement to test the...