Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

The document suggests using a break statement when the exit condition depends on "something unpredictable." Which of the following is given as an example of such an unpredictable condition?
Options
A When the loop needs to run exactly 10 times.
B When a counter variable reaches a specific number.
C When waiting for user input.
Correct Answer
D When processing a fixed list of items.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 10 under "Break Statement" says, "Use when the exit condition depends on something unpredictable, like user input or a complex check inside."

Hint

"Unpredictable" suggests a factor outside the direct control of a simple loop counter.

Question Info