The Scanner class is complaining that the data being read by the nextInt() method at line 28 is not numeric.
There are problems using the Scanner class's nextLine() and nextInt() methods together. Here's some info on what happens and what to do: Java Scanner not working, difference between next() and nextLine() | Rommel Rico
Also some of my old notes:
Scanner methods can be tricky. The Scanner buffers input and can block waiting for input.
For example if you enter: A word to the wise <PRESS ENTER>
and use next() only "A" is read, and "word to the wise" is left in the buffer.
Your next attempt to get something from Scanner will be to get "word".
nextInt() will fail here.
To clear the buffer, use the nextLine() method.
To test if the next token is an int, use the hasNextInt() method.