@D.K Did you test that code? How many times did the execute the statement in loop?
You should ALWAYs use the default to catch unexpected input.
Type: Posts; User: Norm
@D.K Did you test that code? How many times did the execute the statement in loop?
You should ALWAYs use the default to catch unexpected input.
Please edit your post and wrap your code with code tags:
YOUR CODE HERE
to get highlighting and preserve formatting.
The code needs to test that the user has entered a valid response....
Take a look at the tutorial on while loops:
The while and do-while Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)