← IGCSE Computer Science Paper 2

Recording user prompts and INPUT values in a trace table

A prompt is written in the OUTPUT column. The value the user types for an INPUT is written in that variable's column on that step, taken from the test data.

Understanding Recording user prompts and INPUT values in a trace table in IGCSE Computer Science Paper 2

What it does: The OUTPUT statement displays the prompt, so its text is written in the OUTPUT column. The INPUT statement stores the typed test value in Mark, so the value goes in the Mark column on that step. In a dry run you must use the test data you are given. The inputs are taken from that data in order.

Common mistakes: The command is INPUT Score. The value typed from the test data is stored in Score, so it is written in the Score column on that step. Score ← INPUT is not valid pseudocode. INPUT must be followed by a variable name, so it should be INPUT Num2. The test value (such as 7) is not written in the code. It goes in the Num2 column of the trace table.

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 83–92) 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 "Enter your age". Where is this prompt recorded in the trace table?
In the OUTPUT columnIn the Age variable column
Matches
Step: INPUT Score (test data 40). Trace table: OUTPUT column = 40, Score column left empty
↓
The typed value 40 was written in the OUTPUT column. It belongs in the Score column because INPUT assigns it to that variable.
Applying
Meanings
Term
Trace table INPUT
Meaning
A prompt is written in the OUTPUT column. The value the user types for an INPUT is written in that variable's column on that step, taken from the test data.
Practice
// Test data: 15
Testing
Gaps
Age
Check Answer
Spots
2OUTPUT "Enter a score"
3Score ← INPUT

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

The 'Arctic Fox' badge — Tundra Tracker, 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 "Enter your age". Where is this prompt recorded in the trace table?
A. In the OUTPUT column ✓
B. In the Age variable column
A prompt is text displayed to the user, so it is recorded in the OUTPUT column. It is not stored in a variable.
2. The test data is 15. The program runs INPUT Age. What is recorded for this step?
A. 15 is written in the OUTPUT column
B. 15 is written in the Age column ✓
The value the user types is stored in the INPUT variable, so it goes in that variable's column. The OUTPUT column is only for what the program displays.
3. Which step goes in the OUTPUT column of a trace table?
A. OUTPUT "Enter a number" ✓
B. INPUT Number
OUTPUT displays the prompt, so it is recorded in the OUTPUT column. INPUT Number reads a value, which is recorded in the Number column.
4. Where do the values typed in by the user come from when you complete a trace table?
A. The test data given in the question ✓
B. You choose any value you like each time
In a dry run you must use the test data you are given. The inputs are taken from that data in order.
5. The program runs OUTPUT "Enter a mark" then INPUT Mark. The test data is 72. What is the correct trace table recording?
A. OUTPUT column: 72; Mark column: Enter a mark
B. OUTPUT column: Enter a mark; Mark column: 72 ✓
The prompt text goes in the OUTPUT column and the typed test value goes in the Mark column. The wrong answer swaps them.

Match the Pairs

OUTPUT "Enter age" → In the trace table, write the prompt text Enter age in the OUTPUT column on this step. No variable column changes.
INPUT Age (test data: 15) → In the trace table, write 15 in the Age column on this step. Nothing goes in the OUTPUT column.
A prompt shown to the user is recorded in the OUTPUT column of the trace table → OUTPUT "Enter a mark"
The test value the user types is recorded in the column of the variable named in the INPUT → INPUT Mark
Step: INPUT Score (test data 40). Trace table: OUTPUT column = 40, Score column left empty → The typed value 40 was written in the OUTPUT column. It belongs in the Score column because INPUT assigns it to that variable.
Step: OUTPUT "Enter a mark". Trace table: Mark column = Enter a mark, OUTPUT column left empty → The prompt text was written in the Mark variable column. A prompt is output, so it belongs in the OUTPUT column.

Key Term

Trace table INPUT
A prompt is written in the OUTPUT column. The value the user types for an INPUT is written in that variable's column on that step, taken from the test data.

Fill in the Blanks

1. OUTPUT "Enter your age" INPUT Age
Hint: Type the keyword that reads the user's typed value into a variable. In a trace table, that value goes in the variable's column.
2. OUTPUT "Enter a score" INPUT Score OUTPUT Score
Hint: Type the variable name that stores the value the user enters. Its trace table column gets the test value on this step.
3. OUTPUT "Enter your name" INPUT Name
Hint: Type the keyword that shows a prompt. In a trace table, prompt text is written in the OUTPUT column.
4. OUTPUT "Enter a number" INPUT Num Total ← Total + Num
Hint: Type the variable that holds the test value typed in earlier. Use its value from the trace table.
5. DECLARE Age : INTEGER OUTPUT "Enter your age" INPUT Age
Hint: Type the data type that suits a whole-number age. The test value typed in is stored in Age's column.

Spot the Error

Question 1
A DECLARE Score : INTEGER
B OUTPUT "Enter a score"
C Score ← INPUT
D OUTPUT Score * 2
Line C — The command is INPUT Score. The value typed from the test data is stored in Score, so it is written in the Score column on that step. Score ← INPUT is not valid pseudocode.
Question 2
A OUTPUT "Enter first number"
B INPUT Num1
C OUTPUT "Enter second number"
D INPUT 7
E Total ← Num1 + Num2
Line D — INPUT must be followed by a variable name, so it should be INPUT Num2. The test value (such as 7) is not written in the code. It goes in the Num2 column of the trace table.
Question 3
A INPUT "Enter a mark"
B INPUT Mark
C IF Mark >= 50 THEN
D OUTPUT "Pass"
E ENDIF
Line A — A prompt shown to the user is an OUTPUT, so it should be OUTPUT "Enter a mark". Its text goes in the OUTPUT column of the trace table. INPUT is only for reading a value into a variable.
Question 4
A OUTPUT "Enter a name"
B INPUT Name
C OUTPUT "Hello Name"
Line C — Name is inside the quotes, so it would print the word Name instead of the value typed. It should be OUTPUT "Hello ", Name. Then the OUTPUT column shows the test value that was stored in Name.
Question 5
A OUTPUT Enter a number
B INPUT Num
C Double ← Num * 2
D OUTPUT Double
Line A — Prompt text must be in quotation marks so it is a string. It should be OUTPUT "Enter a number". The text in the quotes is what is written in the OUTPUT column.

Student with a class code? Join your class →