Declaring a variable with DECLARE (8.1b)
Names a variable (Count) and gives its data type (INTEGER) before use. Other types: REAL, STRING, BOOLEAN. Identifiers are capitalised with no spaces.
Understanding Declaring a variable with DECLARE (8.1b) in IGCSE Computer Science Paper 2
What it does: REAL is the data type for numbers with decimal places, so Price is declared as REAL. DECLARE Name : TYPE sets up the variable. It names it and says what type of data it can store. Identifiers cannot contain spaces. Capitalised words joined together, such as TotalScore, are the convention. A name is text, so the type is STRING. BOOLEAN only stores TRUE or FALSE. A colon separates the name from the type. The <- arrow is for assigning a value, not for giving a type.
Common mistakes: The colon between the identifier and the data type is missing. It should be DECLARE Price : REAL. Age was declared as INTEGER, so it cannot store text. It should be Age <- 15.
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 347–357) and word search (Modules 337–357).
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 Count : INTEGERFill in the Blanks
Spot the Error
Student with a class code? Join your class →