DECLARE and data types
Creates a variable called Score with a stated data type. Types: INTEGER, REAL, STRING, CHAR, BOOLEAN. Pick a meaningful name.
Understanding DECLARE and data types in IGCSE Computer Science Paper 2
What it does: REAL is the data type for numbers that can have decimal places, so it fits a price like 4.99. BOOLEAN variables hold only TRUE or FALSE, so they work well as flags like Found in a linear search. A name is made of several characters, so it is a STRING. CHAR holds just one single character. The form is DECLARE name : TYPE. The identifier comes first, then a colon, then the data type. A meaningful identifier such as LivesLeft shows what the variable stores, which makes the algorithm easier to read and check.
Common mistakes: The colon is missing. A declaration must be written DECLARE Name : STRING, with a colon between the identifier and the data type. Height is declared as REAL, so it must hold a number. Quotes make 1.65 a STRING. It should be Height ← 1.65.
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 254–264) and word search (Modules 254–274).
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
DECLARE Score : INTEGERFill in the Blanks
Spot the Error
Student with a class code? Join your class →