All programs are built using three fundamental constructs. AQA 7517 requires you to use all three correctly in pseudocode and understand how they control program flow.
Sequence is the default mode of execution — statements execute one after another, in the order they are written, from top to bottom. No branching or repeating occurs.
DECLARE total : INTEGER total ← 0 total ← total + 10 OUTPUT total ← outputs 10
Every program has sequence as its base. The other two constructs interrupt or repeat parts of the sequence.
Selection allows a program to make decisions — different code paths execute depending on whether a condition is True or False.
IF score >= 70 THEN
OUTPUT "Pass"
ELSE
OUTPUT "Fail"
ENDIF
IF score >= 90 THEN
grade ← "A"
ELSE IF score >= 70 THEN
grade ← "B"
ELSE IF score >= 50 THEN
grade ← "C"
ELSE
grade ← "F"
ENDIF
Used when a single variable or expression is compared against multiple fixed values — cleaner than many ELSE IFs:
CASE OF day
1: OUTPUT "Monday"
2: OUTPUT "Tuesday"
3: OUTPUT "Wednesday"
OTHERWISE: OUTPUT "Invalid"
ENDCASE
CASE OF — not SWITCH. Always use the correct AQA pseudocode keyword. CASE cannot test ranges — it matches exact values only.Iteration (looping) repeats a block of code. AQA 7517 requires three loop types:
Use when the number of repetitions is known in advance.
FOR i ← 1 TO 10
OUTPUT i
NEXT i
Use when the number of iterations is unknown and the condition is checked before the body executes — the loop may not execute at all if the condition is initially False.
WHILE answer ≠ "quit" DO
INPUT answer
ENDWHILE
The loop body always executes at least once — the condition is tested after the body.
REPEAT
INPUT score
UNTIL score >= 0 AND score <= 100
| Loop Type | Condition check | Minimum executions | Use case |
|---|---|---|---|
| FOR | Count-controlled | 0 (if TO < FROM) | Known number of iterations |
| WHILE | Pre-condition | 0 (may never run) | Unknown iterations; may not need to run |
| REPEAT … UNTIL | Post-condition | 1 (always runs once) | Must run at least once; input validation |
Loops can be placed inside other loops. The inner loop completes fully for each iteration of the outer loop. Total iterations = outer iterations × inner iterations.
FOR row ← 1 TO 3
FOR col ← 1 TO 4
OUTPUT row * col
NEXT col
NEXT row
← Outputs 3 × 4 = 12 values
FOR i ← 1 TO 10 runs 10 times (i=1,2,...,10), not 9NEXT i or ENDWHILE / ENDIF — losing marks in exam answersif instead of IF8 questions · instantly marked · AQA 7517 standard
| Term | Definition |
|---|
10 questions · 10 marks · 10 minutes