The while loop
(Display Listing 2.)
If the value of testResult is true, the code
in the body of the loop is executed once.
The code in the body of the
loop consists of two sequential actions:
- Cause the penguin to display "Even, keep on looping" on the screen for
- Update the value of the variable named testResult by asking the
user to enter another integer using the same code as before.