Chapter 5: Loops Flashcards
1
Q
What are the three kinds of loops in Java?
A
While loops, do-while loops, and for loops.
2
Q
What is an iteration?
A
An iteration is what the one-time execution of a loop body is referred to as.
3
Q
What are sentinel values and a sentinel controlled loop?
A
A sentinel value is a specific user input that signifies to end of the loop. These loops are called sentinel-controlled loops.
4
Q
When do you use while & do-while loops compared to for loops?
A
While & do-while loops are often used when the amount of loop iterations is not pre-determined. For loops are often used when the amount of loops is fixed.