Plenary Studio
FeaturesComputer ScienceCode builder

AQA pseudocode trace table questions

A trace table question asks pupils to record the value of every variable, trip by trip, as a program runs. The code builder writes the program in AQA pseudocode, fills in the first rows of the table and leaves the rest for the class, and because the snippet is built by construction the completed table is already known to be right.

app.plenarystudio.co.uk
MDMr Davies
Code Builder
Complete the trace table.
1numbers ← [3, 3, 4, 3]
2total ← 0
3FOR i ← 0 TO LEN(numbers) - 1
4 n ← numbers[i]
5 total ← total + n
6ENDFOR
7OUTPUT total
numberstotalnOutput
[3, 3, 4, 3]0
33
Adds every number in the list to a running total, then prints the total.

A hand-built replica of the real builder page, not a screenshot. Every control shown exists in the product.

Part of the Code builder and OCR Exam Reference Language pages.

Why this works in Computer Science

The table above follows the AQA form. There is one column per variable in the order each is first written, an Output column last, one row per trip round the loop, and a cell stays empty when its variable does not change on that row. The first two rows are completed for the class, which is how the paper presents it, and the remaining three are the question. Turn the blanks off and the same table becomes a worked example for the board.

The pseudocode itself is where AQA differs from the others. Assignment uses the arrow, FOR i ← 0 TO LEN(numbers) - 1 runs to its last value inclusive and closes with ENDFOR, there is no for each loop so a list is always walked by index, and the result is printed with OUTPUT. Pupils who trace it as Python stop one trip early or skip the n ← numbers[i] line, and the empty row in the table shows exactly where that happened.

More Computer Science resources

Sign-ups open

Teach with us
and start building.

Plenary Studio is open to every UK secondary teacher. Sign up free, no card details, and build your first resource in minutes. Join the new wave of teachers bringing Plenary Studio into their classroom.

One inbox, no marketing list. We read every email.

Say hello.

We’d love to hear from teachers, heads of department, and anyone curious about where this is going.

hello@plenarystudio.co.uk

Opens your email client. Nothing is sent to us until you press send there.