← IGCSE Computer Science Paper 2

Constructing a full solution: decompose, draw and write

Abstract the scenario, split it into inputs, processes, outputs and storage, draw a structure diagram, then write a flowchart or pseudocode for each part and check it against the requirements.

Understanding Constructing a full solution: decompose, draw and write in IGCSE Computer Science Paper 2

What it does: The structure diagram breaks the main login problem into smaller sub-systems, with the whole system at the top and the sub-problems below it. You must understand and simplify the problem first. Decomposing and drawing come before writing the detailed algorithm for each part. The user types the username and password (inputs). The program compares them with stored details (process) and then shows a message (output). Abstraction keeps only the details needed to solve the problem. The limit is essential, but the casing colour does not affect the solution. In Cambridge pseudocode, an IF statement must finish with ENDIF. NEXT belongs to FOR loops.

Common mistakes: Cambridge pseudocode reads a value from the user with INPUT, not READ. The login input should be INPUT Pass. An IF condition must be followed by THEN. The line should be IF Temp > 30 THEN.

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 136–145) and word search (Modules 123–145).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which order builds a full solution correctly?
Abstract, decompose, draw a structure diagram, then write flowcharts or pseudocodeWrite pseudocode first, then abstract, then decompose
Matches
Login system: Get details, Check details, Show result (no inputs, outputs or storage listed)
↓
The scenario was not decomposed into inputs, processes, outputs and storage, so the design cannot be fully checked.
Applying
Meanings
Term
abstract, decompose, draw, write
Meaning
Abstract the scenario, split it into inputs, processes, outputs and storage, draw a structure diagram, then write a flowchart or pseudocode for each part and check it against the requirements.
Practice
PROCEDURE CheckTemp(Temp : REAL)
Testing
Gaps
Password
Check Answer
Spots
1OUTPUT "Enter password"
2READ Pass

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

The 'Oryx' badge — Desert Navigator, 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. Which order builds a full solution correctly?
A. Abstract, decompose, draw a structure diagram, then write flowcharts or pseudocode ✓
B. Write pseudocode first, then abstract, then decompose
You must understand and simplify the problem first. Decomposing and drawing come before writing the detailed algorithm for each part.
2. A simple login system. Which list shows its inputs, process and output?
A. Inputs: access granted message. Process: display the username. Output: password typed by user
B. Inputs: username and password. Process: compare with stored details. Output: access granted or denied message ✓
The user types the username and password (inputs). The program compares them with stored details (process) and then shows a message (output).
3. In the login system, where would the stored usernames and passwords be placed in the decomposition?
A. Storage ✓
B. Output
The saved usernames and passwords are kept in storage so the process can compare the typed details with them.
4. A temperature alarm checks a sensor reading. Which is the process?
A. Compare the temperature with the limit ✓
B. Read the temperature from the sensor
Reading the sensor is the input. Comparing the reading with the limit is the process. Sounding the alarm is the output.
5. Which detail can be ignored when abstracting the temperature alarm scenario?
A. The temperature limit that triggers the alarm
B. The colour of the sensor casing ✓
Abstraction keeps only the details needed to solve the problem. The limit is essential, but the casing colour does not affect the solution.

Match the Pairs

Inputs: username, password Process: compare with stored details Output: Access granted / denied Storage: user file → Decomposing a simple login system into inputs, processes, outputs and storage
IF Temp > 30 THEN OUTPUT "ALARM" ENDIF → Pseudocode for the decision part of a temperature alarm sub-system
Draw a structure diagram: the top box is the whole system and the lower boxes are its sub-systems → Login system -> Get details, Check details, Show result
Write pseudocode for one sub-problem as a procedure, which the main program calls → PROCEDURE CheckTemp IF Temp > 30 THEN OUTPUT "ALARM" ENDIF ENDPROCEDURE
Login system: Get details, Check details, Show result (no inputs, outputs or storage listed) → The scenario was not decomposed into inputs, processes, outputs and storage, so the design cannot be fully checked.
Temperature alarm pseudocode written, but never compared with the requirement 'sound alarm if above 30' → The design was not checked against the original requirements, so errors such as a wrong limit or a missing alarm output may go unnoticed.

Key Term

abstract, decompose, draw, write
Abstract the scenario, split it into inputs, processes, outputs and storage, draw a structure diagram, then write a flowchart or pseudocode for each part and check it against the requirements.

Fill in the Blanks

1. OUTPUT "Enter password" INPUT Password
Hint: Type the keyword that reads a value typed by the user into a variable.
2. Threshold ← 40 INPUT Temp
Hint: Type the pseudocode symbol that stores a value in a variable (typed as an arrow).
3. CALL GetLogin CALL CheckLogin CALL ShowResult
Hint: Type the keyword that runs a procedure from the main program, one for each sub-problem.
4. FUNCTION CheckPassword(Pw) RETURNS BOOLEAN RETURN Pw = StoredPassword ENDFUNCTION
Hint: Type the keyword in the function header that introduces the data type of the value sent back.
5. IF Temp > 40 THEN OUTPUT "Alarm on" ENDIF
Hint: The requirement says the alarm sounds when the temperature is above the limit. Type the matching comparison operator.

Spot the Error

Question 1
A OUTPUT "Enter password"
B READ Pass
C IF Pass = Stored THEN
D OUTPUT "Welcome"
E ENDIF
Line B — Cambridge pseudocode reads a value from the user with INPUT, not READ. The login input should be INPUT Pass.
Question 2
A PROCEDURE CheckTemp(Temp)
B IF Temp > 30
C OUTPUT "ALARM"
D ENDIF
E ENDPROCEDURE
Line B — An IF condition must be followed by THEN. The line should be IF Temp > 30 THEN.
Question 3
A FUNCTION Ok(P) RETURNS BOOLEAN
B Match ← P = Stored
C RETURN Match
D ENDPROCEDURE
Line D — A FUNCTION must be closed with ENDFUNCTION. ENDPROCEDURE only closes a PROCEDURE.
Question 4
A Count ← 0
B WHILE Count < 3 DO
C Count ← Count - 1
D OUTPUT "Try again"
E ENDWHILE
Line C — The login attempt counter must go up by 1 each time so the loop stops after 3 attempts. With - 1 it never reaches 3, so the loop never ends. It should be Count ← Count + 1.
Question 5
A Total ← 0
B FOR Day ← 1 TO 7
C OUTPUT Temp
D Total ← Total + Temp
E NEXT Day
Line C — The temperature is an input from the sensor, so the program must use INPUT Temp. OUTPUT would not read a value, and Total would not be calculated correctly.

Student with a class code? Join your class →