Naziru Gelajo wrote:This might actually have something to do with the weird behavior of the Scanner Class. I believe that when you read input from an integer, and then afterwards from a String, it skips over the String. A test for instance could be to test again with another "int-based question". Ask the user something like how many times have they voted before instead and see if it goes through. Have the Scanner object read in an int as opposed to a String.
I suppose you could speculate and experiment... or you could follow the links provided above to the explanations that already exist ¯\_(ツ)_/¯
Junilu Lacar wrote:Here's a direct link to the long answer that is referenced in the Java Beginners FAQ: https://coderanch.com/t/676482/Scanner-nextLine-gotcha
Very nice explanation.