IGCSE Computer Science 0478: How to Complete a Trace Table Without Losing Marks

 

By Zaheer | Updated 14 October 2026

Disclosure: I created the IGCSE Computer Science 0478 Mission Control app mentioned at the end and sell it on Gumroad. Everything in this post is free to use without it. This is independent study material, not affiliated with Cambridge or any exam board.

Trace tables are some of the most predictable marks in IGCSE Computer Science. You are given a short algorithm and some input values, and you fill in a table to show what happens at every step. Students lose marks here not because the idea is hard, but because of small slips: a missing starting value, a loop run once too many times, or an output written in the wrong place. This post shows a reliable method, a worked example, the five most common mistakes, and three tasks to try yourself.

What a trace table is for

A trace table records the value of each variable as an algorithm runs, so you can see what it does without running it on a computer. Examiners use it to check that you can follow the logic one line at a time and not guess what the algorithm "should" do.

The five-step method

  1. Make a column for every variable, plus a column for any condition being tested and a column for OUTPUT. If the question gives you column headings, use exactly those.
  2. Write the starting values first. Any variable set before a loop (such as Total ← 0) gets its own row.
  3. Work through the code line by line. Never skip ahead, and never assume what the program is trying to do.
  4. Add one row for each pass of a loop. Only change the variables that actually change, and carry the rest down unchanged.
  5. Fill the OUTPUT column at the moment the output instruction runs, not before and not after.

A worked example

Here is a short algorithm written in pseudocode. The input values, in order, are 7, 12, 3, 15.

Total ← 0
Count ← 0
FOR i ← 1 TO 4
   INPUT Number
   IF Number > 10 THEN
      Total ← Total + Number
      Count ← Count + 1
   ENDIF
NEXT i
OUTPUT Total, Count

The loop runs four times, because i goes 1, 2, 3, 4. Here is the completed trace table:

i Number Number > 10 Total Count OUTPUT
00
17FALSE00
212TRUE121
33FALSE121
415TRUE27227, 2

Notice what the table does:

  • The first row holds only the starting values of Total and Count.
  • The rows for i = 1 and 3 show FALSE, so nothing changes and the totals are carried down.
  • The OUTPUT appears once, in the last row, because OUTPUT comes after the loop has finished.

Five mistakes that cost marks

  1. Leaving out the starting values. The initial row is easy to forget, and it is often worth a mark.
  2. Changing the wrong variable in a row. Update only what the code changes on that pass, and copy the rest down.
  3. Running a loop the wrong number of times. FOR i ← 1 TO 4 runs four times, not three. A WHILE loop checks its condition before every pass, including the first, and stops as soon as the condition is false.
  4. Putting the output in the wrong place. Write each output on the row where the OUTPUT line actually runs, in the right order.
  5. Guessing instead of tracing. Do not decide what the algorithm "is meant to do". Follow the instructions exactly, including MOD (the remainder after division) and DIV (division that gives a whole number).

Try these three tasks

Draw the table yourself before reading the answers.

Task 1. Run the same algorithm as the worked example, but with the input values 20, 4, 11, 9. What is the output?

Task 2. Trace this algorithm and state everything it outputs.

X ← 3
Y ← 1
WHILE Y < 20
   Y ← Y * X
   OUTPUT Y
ENDWHILE

Task 3. Trace this algorithm and state the output.

Count ← 0
FOR N ← 1 TO 6
   IF N MOD 2 = 0 THEN
      Count ← Count + N
   ENDIF
NEXT N
OUTPUT Count

Answers

  1. Task 1: 20 is greater than 10, so Total becomes 20 and Count becomes 1. 4 is not greater than 10, so nothing changes. 11 is greater than 10, so Total becomes 31 and Count becomes 2. 9 is not greater than 10, so nothing changes. Output: 31, 2.
  2. Task 2: Y starts at 1. Pass 1: 1 < 20, so Y = 3 and 3 is output. Pass 2: 3 < 20, so Y = 9 and 9 is output. Pass 3: 9 < 20, so Y = 27 and 27 is output. Then 27 < 20 is false, so the loop stops. Output: 3, 9, 27.
  3. Task 3: Only the even values of N are added, because N MOD 2 = 0 is true only when N is even. Count goes 0, 2, 2, 6, 6, 12 over the six passes. Output: 12.

Quick checklist

  • I have a column for every variable, any condition, and OUTPUT.
  • I wrote the starting values in their own row.
  • I counted how many times the loop really runs.
  • I changed only the variables that change, and carried the others down.
  • I wrote each output on the row where it actually happens.

Practise more

My IGCSE Computer Science 0478 Mission Control app includes a trace table stepper that lets you walk through an algorithm one step at a time, alongside flashcards, multiple-choice questions and a logic gate builder: IGCSE Computer Science 0478 Mission Control.

The pseudocode here is written for practice. Always check the official syllabus and pseudocode guide from your exam board for the exact style used in your exams. No exam result is guaranteed.

Comments

Popular posts from this blog

How to Write Reusable AI Image Prompts with Variables (5 Templates You Can Copy)

Competitive Analysis Made Simple: What a Decision-Ready Competitor Report Includes

Why You Can Rank #1 on Google and Still Be Invisible to ChatGPT (AEO Explained)