CASE OF…ENDCASE (8.1b)
Compares one variable (here Choice) with a list of values, runs the statement beside the matching value, and is closed by ENDCASE.
Understanding CASE OF…ENDCASE (8.1b) in IGCSE Computer Science Paper 2
What it does: The layout is value : statement, so the statement beside the matching value is the one that runs. CASE works on INTEGER or CHAR variables. Each CHAR value is in single quotes and is on its own line, and the statement is closed by ENDCASE. A CASE statement starts with CASE OF followed by the identifier. THEN belongs to IF statements, not CASE. The statement must end with ENDCASE. Ending it with ENDIF is a syntax error.
Common mistakes: The CASE line is missing the keyword OF. It should be CASE OF Choice. A CASE clause needs a colon between the value and the statement, not an equals sign. It should be 'B' : OUTPUT "Good".
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 369–378) and word search (Modules 358–378).
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
CASE OF ChoiceFill in the Blanks
Spot the Error
Student with a class code? Join your class →