Quote (cKranez @ Nov 24 2014 08:58pm)
sec
http://i.imgur.com/eUOzSHH.png
if you look at the error, it says InputMismatchException. lets review the documentation to see what this exception means:
https://docs.oracle.com/javase/7/docs/api/java/util/InputMismatchException.htmlQuote
Thrown by a Scanner to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type.
looking further at your stacktrace, it tells you the error is on line 22 of your main method, when you call nextInt.
if you review the documentation for Scanner's nextInt() method, it states InputMismatchException can be thrown under certain scenarios:
https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html#nextInt()Quote
InputMismatchException - if the next token does not match the Integer regular expression, or is out of range
look at your input. you're entering a string "rock" and you're calling nextInt. given what i said above, what do you think the problem might be?
This post was edited by carteblanche on Nov 24 2014 08:09pm