Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


What describes a condition controlled loop?

  1. A loop that executes a fixed number of times

  2. A loop that runs until a specific condition is met

  3. A loop that never terminates

  4. A loop that is dependent on user feedback

The correct answer is: A loop that runs until a specific condition is met

A condition-controlled loop is characterized by its operation based on the evaluation of a specific condition. In this type of loop, the execution continues until a particular condition evaluates to false. This allows for flexibility, as the loop can run for an indeterminate number of iterations based on the changing state of the variables involved or other external factors. It is commonly used in programming scenarios where the exact number of iterations is not known beforehand, making it suitable for tasks like reading user input until a sentinel value is reached or processing elements in a data structure until a certain criteria is satisfied. The other options represent different types of loops. A loop that executes a fixed number of times describes a count-controlled loop, which is predefined based on a specific count. A loop that never terminates describes an infinite loop, which occurs when the loop's exit condition can never be satisfied. Lastly, a loop that depends on user feedback suggests interaction with the end user, but that doesn’t necessarily align with the broad definition of a condition-controlled loop, as it is not restricted to user-driven feedback. Thus, the essence of what makes option B correct lies in its focus on the conditional aspect that determines when the loop stops executing.