Chapter 5: Loops Flashcards

1
Q

What are the three kinds of loops in Java?

A

While loops, do-while loops, and for loops.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an iteration?

A

An iteration is what the one-time execution of a loop body is referred to as.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly