Choosing a suitable data type for a value
Pick INTEGER, REAL, CHAR, STRING or BOOLEAN by what the value is and what you do with it, then justify with 'because'. Eg price is REAL because it has pence.
Understanding Choosing a suitable data type for a value in IGCSE Computer Science Paper 2
What it does: A whole number used in calculations is stored as INTEGER, and the 'because' reason justifies the choice. One character only means CHAR is the suitable type for an initial. Prices usually include pence, so they need REAL. INTEGER would lose the decimal part. CHAR holds exactly one character. An address is many characters of text (and includes numbers and spaces), so it is a STRING. A fact with only two possible values points to BOOLEAN. It is simpler and safer than storing text. A mark needs a reason linked to the value. Say why the type fits, for example that the price can have pence, rather than just repeating the data name.
Common mistakes: Whether someone is a member has only two possible values (yes or no), so it should be BOOLEAN, not STRING. Correct line: DECLARE IsMember : BOOLEAN. A price has pence, so it needs decimal places. It must be REAL because INTEGER only stores whole numbers. Correct line: DECLARE Price : REAL.
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 327–336) and word search (Modules 317–336).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
data typeFill in the Blanks
Spot the Error
Student with a class code? Join your class →