44.4k views
1 vote
A __________ -controlled loop uses a true/false condition to control the number of times that it repeats.

decision
sentinel/condition
counter
Boolean

User Hyzyr
by
7.8k points

1 Answer

5 votes

Final answer:

A sentinel/condition-controlled loop uses a true/false condition to control the number of times it repeats based on specific criteria.so the correct answer is sentinel/condition.

Step-by-step explanation:

A sentinel/condition-controlled loop operates based on a true/false condition to determine its iteration count.

This loop structure repeatedly executes a block of code until a predefined condition becomes false.

It relies on sentinel values or specific conditions to either continue or terminate the loop.

Unlike counter-controlled loops that iterate based on a fixed count, the sentinel/condition-controlled loop provides flexibility in termination, allowing the loop to halt upon meeting a particular condition.

This mechanism empowers programmers to create loops that adapt to changing conditions or dynamic datasets,

making it a versatile construct for scenarios where the number of iterations cannot be predetermined but rather relies on specific conditions for continuation or termination.

So the correct answer is sentinel/condition.

User Ed Ball
by
8.1k points