There are several ways to iterate in
Java. At the basic level, there are 2 that you need to be familiar with (aside from the for-next):
1. the while loop. In this structure, the looping condition is evaluated before the loop is entered. The loop may never be entered, depending on the condition.
2. the do-while loop. In this structure, the looping condition is evaluated at the end of the loop. The loop will always be executed at least once, because the condition is evaluated post-loop.
in your example, clearly the do-while is appropriate. Take a look at your text...
you should have something along the lines of: