AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Examples of indefinite (condition controlled) iteration with the condition…

    Full specification wording

    Programming concepts: Examples of indefinite (condition controlled) iteration with the condition at the end would be:

    Indefinite iteration repeats code an unknown number of times, continuing while or until a condition is met.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 14 of 23

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Indefinite iteration repeats code an unknown number of times, continuing while or until a condition is met. When the condition is tested at the end, the loop body always runs at least once before the test, so it is a post-condition (post-test) loop. In AQA pseudocode this is written as REPEAT, then the instructions, then UNTIL followed by the condition. The loop stops when the condition becomes true, so the body repeats while the condition is false. Contrast this with a condition at the start (WHILE), which may run zero times. A typical example is repeatedly asking for a password until the correct one is entered: the prompt must appear at least once. Recognising where the condition sits tells you the minimum number of executions.

    What earns the marks

    • Identifies that indefinite (condition controlled) iteration repeats an unknown number of times until a condition is satisfied.
    • Recognises that placing the condition at the end makes it a post-condition loop whose body executes at least once.
    • Matches the REPEAT … UNTIL structure to the condition-at-the-end form.
    • Distinguishes it from a condition-at-the-start WHILE loop, which may execute zero times.
    • Explains that the loop continues while the condition is false and stops when it becomes true.

    Common mistakes and how to put them right

    • Assuming a condition-at-the-end loop can run zero times.

      Put it right: The body always runs at least once before the test.

    • Confusing REPEAT … UNTIL with a WHILE loop.

      Put it right: In REPEAT … UNTIL the condition is checked after the body.

    • Thinking the loop stops when the condition is false.

      Put it right: It repeats until the condition is true.

    Exam tips

    • Look at where the condition is written: at the end means post-condition, at the start means pre-condition.
    • State the minimum number of executions to justify your choice.
    • Use a concrete example such as entering a password until it is correct to show the body must run at least once.

    Try the lesson

    The start of the Programming concepts: Examples of indefinite (condition controlled) iteration with the condition at the end would be: lesson, made from checked teaching notes for this specification point.

    Have a go first

    Which structure is an example of indefinite iteration where the condition is tested at the end of the loop?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Programming concepts: Examples of indefinite (condition controlled) iteration with the condition at the end would be:

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge