← IGCSE Computer Science Paper 2

The OUTPUT column of a trace table

The trace table column where you write each value or message shown by an OUTPUT statement, on the row where it happens. Text in quotes is copied exactly as the output.

Understanding The OUTPUT column of a trace table in IGCSE Computer Science Paper 2

What it does: The quotes mark text, not a variable. The word Pass is written exactly as it appears, with no variable lookup. The OUTPUT is not part of the loop body, so nothing is written to the OUTPUT column during the repeats. The final value of Total is written just once at the end. OUTPUT shows the value held in the variable, not the variable name. Write 15. Each output is recorded on the row where it happens, so the table shows when it was displayed. A statement after the loop runs only once, when the loop has finished. Write it once.

Common mistakes: The text and the variable must be separated by a comma. It should be OUTPUT "X is ", X so the OUTPUT column shows X is 4 on that row. Text to be shown exactly must be in quotes. Without quotes, Hello would be treated as a variable. It should be OUTPUT "Hello ", Name, giving Hello Sam in the OUTPUT column.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 71–82) and word search (Modules 71–92).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A program runs OUTPUT Total, and Total holds 15. What goes in the OUTPUT column?
15Total
Matches
OUTPUT "Score" (Score is 8, but 8 is written in the OUTPUT column)
↓
The word Score is in quotes, so it is text. The OUTPUT column should show Score, not the value 8.
Applying
Meanings
Term
OUTPUT column
Meaning
The trace table column where you write each value or message shown by an OUTPUT statement, on the row where it happens. Text in quotes is copied exactly as the output.
Practice
Total ← 0
Testing
Gaps
Total
Check Answer
Spots
1X ← 4
2OUTPUT "X is " X

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Snow Leopard' badge — Silent Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A program runs OUTPUT Total, and Total holds 15. What goes in the OUTPUT column?
A. Total
B. 15 ✓
OUTPUT shows the value held in the variable, not the variable name. Write 15.
2. The program runs OUTPUT "Score: ", Score and Score holds 8. What goes in the OUTPUT column?
A. Score: 8 ✓
B. 8
The text in quotes is part of the output and is copied exactly. The value of Score follows it.
3. Where do you write the result of an OUTPUT statement in a trace table?
A. On the row where the OUTPUT statement runs ✓
B. On the last row of the table
Each output is recorded on the row where it happens, so the table shows when it was displayed.
4. FOR Count ← 1 TO 3 contains OUTPUT Count inside the loop. How is the OUTPUT column filled in?
A. 1, then 2, then 3, each on its own row ✓
B. 1 2 3 all written on the final row
The OUTPUT statement runs once on each repeat, so each value goes on the row for that repeat.
5. OUTPUT "Finished" comes after the end of a loop. How often is Finished written in the OUTPUT column?
A. On every row of the loop
B. Once, on the row after the loop ends ✓
A statement after the loop runs only once, when the loop has finished. Write it once.

Match the Pairs

OUTPUT "Total: ", Total → Writes the text Total: followed by the current value of Total, together in the OUTPUT column on that row.
FOR I ← 1 TO 3 OUTPUT I NEXT I → Writes 1, then 2, then 3 on three separate rows of the OUTPUT column.
Text in quotes is part of the output, so it is copied exactly into the OUTPUT column. → OUTPUT "Pass"
An OUTPUT placed after a loop is written once, on the row after the loop has finished. → FOR I ← 1 TO 3 Total ← Total + I NEXT I OUTPUT Total
OUTPUT "Score" (Score is 8, but 8 is written in the OUTPUT column) → The word Score is in quotes, so it is text. The OUTPUT column should show Score, not the value 8.
FOR I ← 1 TO 3 OUTPUT I NEXT I (only 3 is written in the OUTPUT column) → The OUTPUT is inside the loop, so it happens on every repeat. Writing only the last value misses the first two outputs.

Key Term

OUTPUT column
The trace table column where you write each value or message shown by an OUTPUT statement, on the row where it happens. Text in quotes is copied exactly as the output.

Fill in the Blanks

1. Total ← 5 + 3 OUTPUT Total
Hint: Type the keyword that displays the value, which you then write in the OUTPUT column of the trace table.
2. Total ← 12 OUTPUT "Total: ", Total
Hint: Type the variable whose value is shown after the quoted text, so both parts go together in one OUTPUT cell.
3. FOR Count ← 1 TO 3 OUTPUT Count NEXT Count
Hint: Type the loop variable that is output on every pass, giving one new OUTPUT value on each row.
4. Total ← Total + Count NEXT Count OUTPUT "Sum: ", Total
Hint: Type the keyword that shows the message once, after the loop has finished, on the last row of the trace table.
5. Price ← 8 Tax ← Price DIV 2 OUTPUT "Tax: ", Tax
Hint: Type the operator that gives the whole-number result of a division, so you know the value to write after the quoted text in the OUTPUT column.

Spot the Error

Question 1
A X ← 4
B OUTPUT "X is " X
C X ← X * 2
D OUTPUT "X is ", X
Line B — The text and the variable must be separated by a comma. It should be OUTPUT "X is ", X so the OUTPUT column shows X is 4 on that row.
Question 2
A Name ← "Sam"
B OUTPUT Hello, Name
C OUTPUT "Bye"
Line B — Text to be shown exactly must be in quotes. Without quotes, Hello would be treated as a variable. It should be OUTPUT "Hello ", Name, giving Hello Sam in the OUTPUT column.
Question 3
A OUTPUT Start
B Count ← 3
C OUTPUT Count
Line A — Start has no quotes, so it is treated as a variable that does not exist. It should be OUTPUT "Start" so the word Start is written in the OUTPUT column.
Question 4
A PRINT "Pass mark: ", 50
B Mark ← 62
C OUTPUT "Mark: ", Mark
Line A — Cambridge pseudocode uses OUTPUT, not PRINT. Only an OUTPUT statement puts a value in the OUTPUT column, so the line should be OUTPUT "Pass mark: ", 50.
Question 5
A FOR I ← 1 TO 3
B Sq ← I * I
C OUTPUT "Sq"
D NEXT I
E OUTPUT "Done"
Line C — Quotes make Sq literal text, so the OUTPUT column would show Sq every time. It should be OUTPUT Sq to show the values 1, 4 and 9, one on each loop row.

Student with a class code? Join your class →