Trace Table Example

Test yourself on Trace Tables with exam style questions, marked instantly.

Flashcards that come back just before you would forget them.

A revision plan that remembers what you know and shows what to do next.

See which topics you have nailed and which need another look.

Quiz yourself on Trace TablesGet your flashcardsBuild my revision planTrack my progress

Trace Table Example

Trace table for a loop that adds the numbers 1 to 5. Five lines of pseudocode: total = 0, FOR i = 1 TO 5, total = total + i, NEXT i, OUTPUT total. Below them is a trace table with columns i, total and OUTPUT. The total starts at 0, then becomes 1, 3, 6, 10 and 15 as i goes from 1 to 5. The last row, shaded green, shows OUTPUT 15.

The trace table has one column for each variable (i and total) and one for OUTPUT. The row for total = 0 comes before the loop starts, and the green row is the OUTPUT line. This pseudocode ends the loop with NEXT i, which is OCR style. AQA writes ENDFOR instead. Edexcel does not set a strict pseudocode style.

Make this stick

Signing in gives access to all PrepWise features.

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.