← IGCSE Computer Science Paper 2

Inputs, processes and outputs of an algorithm

Every algorithm takes INPUT data, carries out processes on it (calculations, decisions, storing in variables or arrays), then gives OUTPUT results.

Understanding Inputs, processes and outputs of an algorithm in IGCSE Computer Science Paper 2

What it does: Adding the input Mark to Total is a calculation, and the result is stored in the variable Total, so it is a process. An IF statement tests a condition on the input data, which makes it a decision process. Decisions such as IF statements are processes. The score was already read in by an earlier INPUT statement. Variables and arrays store values so the processes can use them. OUTPUT only displays results. C is worked out by a process (A * B), not entered by the user. Only A and B are INPUT. Assignment with ← stores a value. It is a process, not an output, because nothing is shown to the user.

Common mistakes: The calculation stores its result in a variable, so it needs the assignment arrow. It should be Area ← Length * Width. A single = is used for comparison. The algorithm needs Mark as its input. Line 1 should be INPUT Mark so the value is read in, not OUTPUT Mark, which would display a value that does not exist yet.

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 216–231) and word search (Modules 188–231).

Take this worksheet further — free with Cloodit

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

Learning
Duo
In the line INPUT Mark, what part of the algorithm is this?
An output: a result is shown to the userAn input: data is read into the algorithm
Matches
Inputs: Total ← Total + Mark
↓
This is a process (a calculation stored in a variable), not an input. The input is the INPUT Mark statement that brings the value in.
Applying
Meanings
Term
Input, process, output
Meaning
Every algorithm takes INPUT data, carries out processes on it (calculations, decisions, storing in variables or arrays), then gives OUTPUT results.
Practice
INPUT Mark
Testing
Gaps
Price
Check Answer
Spots
2INPUT Width
3Area = Length * Width

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

The 'Zebra' badge — Pattern Matcher, 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. In the line INPUT Mark, what part of the algorithm is this?
A. An input: data is read into the algorithm ✓
B. An output: a result is shown to the user
INPUT statements bring data into the algorithm. Here the value is stored in the variable Mark.
2. Which statement is an OUTPUT in an algorithm?
A. Total ← Total + 1
B. OUTPUT Total ✓
OUTPUT displays a result to the user. Total ← Total + 1 is a process (a calculation that stores a value).
3. Which line is a process?
A. Average ← Total / 5 ✓
B. INPUT Total
A calculation is a process. INPUT only reads a value in; it does not work anything out.
4. Is IF Score >= 50 THEN a process or an input?
A. An input: it reads the score from the user
B. A process: it makes a decision ✓
Decisions such as IF statements are processes. The score was already read in by an earlier INPUT statement.
5. Where is a value kept while the algorithm uses it between input and output?
A. In a variable or an array ✓
B. In an OUTPUT statement
Variables and arrays store values so the processes can use them. OUTPUT only displays results.

Match the Pairs

INPUT Mark → An input: the algorithm takes a value from the user and stores it in the variable Mark
OUTPUT "Total: ", Total → An output: the algorithm displays a message and the value of Total to the user
A process: a calculation that works on the input data and stores the result in a variable → Total ← Total + Mark
A process: a decision that chooses what happens next depending on the input → IF Mark >= 50 THEN
Inputs: Total ← Total + Mark → This is a process (a calculation stored in a variable), not an input. The input is the INPUT Mark statement that brings the value in.
Outputs: Count ← Count + 1 → This is a process (counting stored in a variable), not an output. Nothing is shown to the user until an OUTPUT statement such as OUTPUT Count runs.

Key Term

Input, process, output
Every algorithm takes INPUT data, carries out processes on it (calculations, decisions, storing in variables or arrays), then gives OUTPUT results.

Fill in the Blanks

1. INPUT Price Total ← Price * 2 OUTPUT Total
Hint: Type the keyword that reads a value from the user into the variable.
2. INPUT Price INPUT Qty Total ← Price * Qty
Hint: Type the arithmetic operator for the calculation (process) that multiplies two values.
3. INPUT Mark IF Mark >= 50 THEN OUTPUT "Pass"
Hint: Type the keyword that starts a decision (a process) in the algorithm.
4. INPUT Age NextAge ← Age + 1 OUTPUT NextAge
Hint: Type the keyword that shows the result to the user.
5. FOR Count ← 1 TO 3 INPUT Scores[Count] NEXT Count
Hint: Type the loop variable that picks which array element stores each input.

Spot the Error

Question 1
A INPUT Length
B INPUT Width
C Area = Length * Width
D OUTPUT Area
Line C — The calculation stores its result in a variable, so it needs the assignment arrow. It should be Area ← Length * Width. A single = is used for comparison.
Question 2
A OUTPUT Mark
B IF Mark >= 50 THEN
C OUTPUT "Pass"
D ENDIF
Line A — The algorithm needs Mark as its input. Line 1 should be INPUT Mark so the value is read in, not OUTPUT Mark, which would display a value that does not exist yet.
Question 3
A INPUT Price
B INPUT Quantity
C Total ← Price * Qty
D OUTPUT Total
Line C — Qty was never input or declared. The process must use the input variable Quantity: Total ← Price * Quantity.
Question 4
A INPUT Cost
B Cost * 0.2 ← Tax
C Final ← Cost + Tax
D OUTPUT Final
Line B — The variable being assigned to must be on the left of the arrow and the calculation on the right. It should be Tax ← Cost * 0.2.
Question 5
A DECLARE Marks : ARRAY[1:3] OF INTEGER
B FOR Count ← 1 TO 3
C INPUT Marks[Count]
D ENDFOR
E OUTPUT Marks[1]
Line D — A FOR loop in IGCSE pseudocode ends with NEXT followed by the loop variable, so line 4 should be NEXT Count. ENDFOR is not a pseudocode keyword.

Student with a class code? Join your class →