Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

When is the break statement most appropriately used, according to the 'When to use Break?' slide?
Options
A When you know exactly when the loop should end based on a fixed number.
B When the exit condition depends on something unpredictable like user input.
Correct Answer
C To pause the loop for a short duration.
D To skip the current iteration and move to the next.
Correct Answer

Option B is the correct answer.

Detailed Explanation

The 'Break Statement' section on page 10 states it's used 'when the exit condition depends on something unpredictable, like user input or a complex check inside.' This contrasts with 'Normal Condition' where the end is known.

Hint

Consider the difference between 'Normal Condition' and 'Break Statement' usage on page 10.

Question Info