← IGCSE Computer Science Paper 2

Abstraction (7a)

Keeping only the details needed to solve a problem and leaving out the details that do not matter, e.g. a map shows roads but not every tree.

Understanding Abstraction (7a) in IGCSE Computer Science Paper 2

What it does: The score is a relevant detail the game must track. Tiny details such as the colour of each blade of grass are left out. The stop is a useful detail for a route. Storing the bus colour would be an irrelevant detail, so abstraction leaves it out. Abstraction means keeping the useful details and ignoring the ones that do not matter. The map leaves out irrelevant details (house colours) and keeps the relevant ones (routes and stops). Ignoring unnecessary detail makes the problem easier to understand and solve. Speed affects who wins the race. The keyboard brand does not change the game's rules, so it is ignored.

Common mistakes: Comments in Cambridge pseudocode start with //, not #. It should be // Bus map: only useful data. The program also shows abstraction: a bus map stores stop names and numbers but not details like tree colour. Shoe size is an irrelevant detail for a report system, and Mark is now never declared. Abstraction keeps only what is needed, so line 3 should be DECLARE Mark : INTEGER.

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 1–16) and word search (Modules 1–26).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which statement best describes abstraction?
Keeping only the details needed to solve the problemAdding as many details as possible to the problem
Matches
DECLARE ShoeColour : STRING // for a school timetable
↓
The shoe colour is an irrelevant detail. A timetable needs only the lessons, times and rooms, so abstraction means leaving it out.
Applying
Meanings
Term
abstraction
Meaning
Keeping only the details needed to solve a problem and leaving out the details that do not matter, e.g. a map shows roads but not every tree.
Practice
// Abstraction: keep only needed details
Testing
Gaps
// keeps only the needed details
Check Answer
Spots
1# Bus map: only useful data
2DECLARE StopName : STRING

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

The 'Golden Eagle' badge — High Flyer, 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 statement best describes abstraction?
A. Adding as many details as possible to the problem
B. Keeping only the details needed to solve the problem ✓
Abstraction means keeping the useful details and ignoring the ones that do not matter.
2. A map for a bus passenger shows bus routes and stops but not the colour of each house. This is an example of:
A. Abstraction ✓
B. Validation
The map leaves out irrelevant details (house colours) and keeps the relevant ones (routes and stops).
3. A school system stores a student's name, class and attendance. Which detail is probably irrelevant?
A. The student's favourite colour ✓
B. The student's class
A favourite colour does not help the school system record attendance, so abstraction leaves it out.
4. Why do programmers use abstraction when analysing a problem?
A. To make the program take longer to write
B. To focus on the important details and make the problem simpler ✓
Ignoring unnecessary detail makes the problem easier to understand and solve.
5. In a racing game, which detail is relevant to the game's rules?
A. The speed of each car ✓
B. The brand of the player's keyboard
Speed affects who wins the race. The keyboard brand does not change the game's rules, so it is ignored.

Match the Pairs

DECLARE StudentName : STRING → A school system keeps a detail it needs, such as a name, and leaves out details like favourite colour
// Ignore the trees and houses → A programmer decides which details to leave out because they do not help solve the problem
A game keeps the score because it matters, but ignores details that do not affect play → Score ← Score + 10
A bus route program stores only the stops it needs and nothing about the bus colour → DECLARE BusStop : STRING
DECLARE ShoeColour : STRING // for a school timetable → The shoe colour is an irrelevant detail. A timetable needs only the lessons, times and rooms, so abstraction means leaving it out.
// Map program: store every tree and every leaf → This keeps far too much detail. Abstraction means keeping only useful details such as roads and landmarks and ignoring the rest.

Key Term

abstraction
Keeping only the details needed to solve a problem and leaving out the details that do not matter, e.g. a map shows roads but not every tree.

Fill in the Blanks

1. // Abstraction keeps only the needed details
Hint: Type the name of the technique that keeps useful details and leaves out the rest.
2. // Hair colour is not needed for the score DECLARE Score : INTEGER
Hint: Type the data type used for a whole-number game score.
3. // A map shows roads but not every tree OUTPUT RoadName
Hint: Type the command that displays a value to the user.
4. // A school system keeps only needed data DECLARE StudentName : STRING
Hint: Type the keyword that creates a variable to store a needed detail.
5. // Only price and quantity matter here Total ← Price * Quantity
Hint: Type the arithmetic operator that multiplies the two needed values.

Spot the Error

Question 1
A # Bus map: only useful data
B DECLARE StopName : STRING
C DECLARE StopNumber : INTEGER
D OUTPUT StopName, StopNumber
Line A — Comments in Cambridge pseudocode start with //, not #. It should be // Bus map: only useful data. The program also shows abstraction: a bus map stores stop names and numbers but not details like tree colour.
Question 2
A // Report: only needed details
B DECLARE StudentName : STRING
C DECLARE ShoeSize : INTEGER
D INPUT StudentName
E INPUT Mark
Line C — Shoe size is an irrelevant detail for a report system, and Mark is now never declared. Abstraction keeps only what is needed, so line 3 should be DECLARE Mark : INTEGER.
Question 3
A DECLARE Score : INTEGER
B DECLARE Lives : INTEGER
C Score ← 0
D Lives = 3
E // Sky colour is not tracked
Line D — Assignment in Cambridge pseudocode uses the ← arrow, not =. Line 4 should be Lives ← 3. The game tracks only Score and Lives and ignores details like sky colour.
Question 4
A DECLARE RoadName : STRING
B DECLARE Distance : DECIMAL
C INPUT RoadName
D INPUT Distance
Line B — DECIMAL is not a Cambridge data type. A distance with decimal places should be declared as REAL, so line 2 should be DECLARE Distance : REAL.
Question 5
A INPUT PlayerName
B INPUT PlayerScore
C OUTPUT PlayerName, AvatarColour
D // Leaderboard ignores avatar
Line C — The leaderboard only needs the name and score. Avatar colour is an irrelevant detail that abstraction leaves out, and it was never input. Line 3 should output PlayerName, PlayerScore.

Student with a class code? Join your class →