Pure sequence — 4 lines, each executed in order. Note: cast USERINPUT to REAL; use STR() before concatenation.
Trace Table
Tracing Sequential Code
a ← 10 b ← 3 c ← a * b + 2 a ← a + b OUTPUT a, b, c
Line
a
b
c
Output
a ← 10
10
—
—
b ← 3
10
3
—
c ← a*b+2
10
3
32
a ← a+b
13
3
32
OUTPUT
13
3
32
13, 3, 32
Common Errors
Avoid These Mistakes
❌ Using variable before assigning
OUTPUT score
score has no value yet — assign first
❌ Forgetting type casting on input
total ← USERINPUT + 10
Fix: total ← INT(USERINPUT) + 10
❌ Concatenating number without STR()
OUTPUT "Answer: " + result
Fix: OUTPUT "Answer: " + STR(result)
AQA Exam Style
Practice Question
AQA 7517 — Paper 1 Style
A student writes: num1 ← INT(USERINPUT) num2 ← INT(USERINPUT) total ← num1 + num2 average ← total / 2 OUTPUT "Average: " + STR(average) The user enters 7 then 13. What is the output?
[2 marks]
1 mark
total = 20; average = 20 / 2 = 10.0
1 mark
Output: Average: 10.0
Summary
Key Points to Remember
Sequence — instructions execute in written order, top to bottom
Assignment ← — evaluate right, store in left. AQA uses ← ; Python uses =
USERINPUT — always returns STRING; cast with INT() or REAL()
OUTPUT — concatenate with + ; numbers need STR() conversion first
Trace tables: track each variable after every assignment