REPEAT…UNTIL loop through two revised, exam-style sample questions, following the Computer Science 2210 syllabus. The lesson begins with a short recap explaining that the REPEAT…UNTIL loop is a post-controlled loop, meaning the statements inside the loop are executed at least once before the condition is checked. This makes it especially suitable for tasks where user input must be taken before any validation can occur.
The first sample question demonstrates how the REPEAT…UNTIL loop can be used for password length validation. In this example, the program repeatedly asks the user to enter a password and checks the condition only after the input is received. If the password length is less than the required minimum of eight characters, the loop repeats and the user is asked again. This continues until the password meets the required length, clearly showing how post-controlled loops are effective for enforcing validation rules.
The second sample question applies the REPEAT…UNTIL loop to exam marks validation, where the user must enter marks between 0 and 100. The program prompts the user to enter the marks, then checks whether the entered value falls within the valid range. If the marks are outside the range, the loop repeats and the user is asked again. The lesson emphasises that the loop only stops when the condition becomes true, ensuring that only valid data is accepted.
By the end of the lesson, students understand how to select and apply the REPEAT…UNTIL loop in different validation scenarios, how to write clear and correct pseudocode using Cambridge standards, and how to explain their logic confidently in examination answers. This lesson helps strengthen students’ problem-solving skills and prepares them to handle REPEAT…UNTIL loop questions effectively in the Computer Science exam.
