I am very new to Java but am working through the book Java: How to program (9th ed.) and have reached an example where for the life of me I cannot figure out what the proble
You should use hasNextInt() before assigning value to variable.
hasNextInt()