Skip to content
Brainlag

Pseudocode and trace tables

Pseudocode describes an algorithm; a trace table follows it line by line.

Reading pseudocode

Look for the inputs, the loop and the condition that ends it, and what is output. Most questions use a handful of structures: assignment, IF, a counted loop, a condition-controlled loop and arrays.

StructureLooks like
Assignmenttotal ← 0
SelectionIF … THEN … ELSE
Counted loopFOR i ← 1 TO 10
Condition loopWHILE x < 5
Arraynames[3]

Trace tables

Give each variable its own column and add a row every time a value changes. Work slowly: most lost marks come from skipping a line.

Lineitotal
10
210
311
221
323

Then write it as code

Python lessonsWrite it as real code, in your browser
Printable pseudocode guideIn the Shop

Questions

Is there one correct pseudocode?

No. Exam boards publish their own style, but any clear, logical pseudocode can get the marks. Use the style your board shows in its papers.

Related

Helps with GCSE computer science (AQA, Pearson Edexcel and OCR). AQA, Pearson Edexcel and OCR are trade marks of their owners. Brainlag is independent and is not affiliated with or endorsed by any exam board.