Ch. 5.9: Focus on Software Engineering: Deciding Which Loop to Use Flashcards
1
Q
When is the while ideal to use?
A
Ideal in situations where you do not want the loop to iterate if the condition is false from the beginning.
2
Q
When is the do-while loop best to use?
A
It is ideal in situations where you always want the loop to iterate at least once.
3
Q
When is the for loop best to use?
A
Is ideal in situations where the exact number of iterations is known.