These errors appear in student answers repeatedly. Check your program against every item before you stop writing.
1. Uninitialised variables
# Wrong — total has no starting value
FOR i ← 0 TO 4
total ← total + scores[i]
NEXT i
# Correct
total ← 0
FOR i ← 0 TO 4
total ← total + scores[i]
NEXT i
Using a variable before assigning it a value is a logic error that produces unpredictable results.
2. Missing ENDIF or ENDWHILE
# Wrong
IF average ≥ 6 THEN
OUTPUT "Pass"
ELSE
OUTPUT "Fail"
# Missing ENDIF — syntax error, program cannot run
Every IF needs ENDIF. Every WHILE needs ENDWHILE. Every FOR needs NEXT. Check these before finishing.
3. Wrong loop type
- FOR — use when you know the exact number of iterations in advance (e.g. "collect 5 scores")
- WHILE — use when you repeat until a condition changes (e.g. "keep asking until valid")
Using a FOR loop for validation forces a fixed number of attempts. Using a WHILE loop to collect exactly 5 scores makes the count harder to control. Match the loop type to the problem.
4. Array index errors
AQA pseudocode arrays are zero-indexed by convention in most contexts. A 5-element array uses indices 0 to 4. A FOR loop to fill it should run FOR i ← 0 TO 4, not 1 TO 5.
5. No validation on user input
If the question describes a range or constraint on input, validate it. An unvalidated input that accepts any value — including impossible ones — is an incomplete answer for any question that asks for a "robust" or "secure" program.
6. Using SUBROUTINE when a value needs to be returned
A SUBROUTINE performs actions but does not return a value. A FUNCTION calculates and returns a value with RETURN. If your code needs to use the result of a called block elsewhere, it must be a FUNCTION.
# Wrong — SUBROUTINE cannot be used to return a value
SUBROUTINE getValidScore()
...
RETURN score # invalid in a SUBROUTINE
ENDSUBROUTINE
# Correct
FUNCTION getValidScore()
...
RETURN score
ENDFUNCTION
7. Vague identifier names
x, a, temp tell the examiner nothing. Use names that reflect the variable's purpose: score, total, average, userName. Clear identifiers also reduce your own mistakes.