An algorithm is designed to restrict access to a high-security vault by tracking user passcode attempts. The pseudocode for this algorithm is shown below:
1 attempts ← 0
2 is_valid ← False
3 WHILE is_valid = False AND attempts < 3 DO
4 passcode ← USERINPUT
5 IF passcode = "90210" THEN
6 is_valid ← True
7 ELSE
8 attempts ← attempts + 1
9 ENDIF
10 ENDWHILE
Identify the line number where indefinite iteration is first initiated in this algorithm.
Line 1
Line 3
Line 5
Line 8
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.