← IGCSE Computer Science Paper 2

Keywords in upper case

IF is a pseudocode keyword. All keywords (IF, ENDIF, WHILE, OUTPUT) are written in upper case and never used as identifier names. Lower case, such as if, is a presentation error.

Understanding Keywords in upper case in IGCSE Computer Science Paper 2

What it does: IF, THEN, OUTPUT and ENDIF are all keywords, so they all appear in upper case in this example. Total is a valid identifier name. Names like IF, WHILE or OUTPUT are keywords and cannot be used for variables. The whole keyword must be in capitals. Mixed case such as Endwhile is also a presentation error.

Common mistakes: OUTPUT is a keyword, so it must be written in upper case. Lower-case output is a presentation error. The line should be OUTPUT "Pass". Every letter of a keyword must be upper case. Output with a capital O and lower-case letters is wrong. It should be OUTPUT Lives.

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 136–145) and word search (Modules 123–145).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line is written correctly in Cambridge pseudocode?
if Score > 50 thenIF Score > 50 THEN
Matches
if Score >= 50 THEN OUTPUT "Pass" endif
↓
The keywords if and endif are in lower case. They should be IF and ENDIF.
Applying
Meanings
Term
IF
Meaning
IF is a pseudocode keyword. All keywords (IF, ENDIF, WHILE, OUTPUT) are written in upper case and never used as identifier names. Lower case, such as if, is a presentation error.
Practice
DECLARE Score : INTEGER
Testing
Gaps
Mark >= 50 THEN
Check Answer
Spots
3IF Score >= 50 THEN
4 output "Pass"

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

The 'Ermine' badge — Tundra Streak, 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 line is written correctly in Cambridge pseudocode?
A. if Score > 50 then
B. IF Score > 50 THEN ✓
Every keyword, including IF and THEN, must be in upper case. Lower case keywords are a presentation error.
2. Which line correctly finishes an IF statement?
A. endif
B. ENDIF ✓
ENDIF is a keyword, so it is written in upper case.
3. Which loop header follows the keyword rule?
A. WHILE Count < 10 DO ✓
B. while Count < 10 do
WHILE and DO are keywords and must be in upper case.
4. Which is the correct way to close a WHILE loop?
A. ENDWHILE ✓
B. Endwhile
The whole keyword must be in capitals. Mixed case such as Endwhile is also a presentation error.
5. Which variable name is allowed in pseudocode?
A. Total ✓
B. IF
Keywords such as IF are reserved and are never used as identifier names. Total is a valid identifier in Pascal case.

Match the Pairs

IF Score >= 50 THEN OUTPUT "Pass" ENDIF → Correct: the keywords IF, THEN, OUTPUT and ENDIF are all written in upper case
WHILE Count < 5 DO Count ← Count + 1 ENDWHILE → Correct: WHILE, DO and ENDWHILE are keywords in upper case, while Count is an identifier in Pascal case
Every keyword in Cambridge pseudocode, including the one that closes a selection, is written in upper case → IF Age >= 16 THEN OUTPUT "Adult" ENDIF
A keyword can never be used as an identifier name, so a variable must have a different name such as Total → DECLARE Total : INTEGER
if Score >= 50 THEN OUTPUT "Pass" endif → The keywords if and endif are in lower case. They should be IF and ENDIF.
DECLARE WHILE : INTEGER → WHILE is a keyword, so it cannot be used as an identifier. Use a name such as Counter instead.

Key Term

IF
IF is a pseudocode keyword. All keywords (IF, ENDIF, WHILE, OUTPUT) are written in upper case and never used as identifier names. Lower case, such as if, is a presentation error.

Fill in the Blanks

1. IF Mark >= 50 THEN OUTPUT "Pass" ENDIF
Hint: Type the keyword that starts a selection statement. Remember that pseudocode keywords are always upper case.
2. IF Mark >= 50 THEN OUTPUT "Pass" ENDIF
Hint: Type the keyword that closes the selection statement, in upper case.
3. WHILE Count <= 5 DO Count ← Count + 1 ENDWHILE
Hint: Type the keyword that begins a loop which checks its condition before each pass. Use upper case.
4. WHILE Count <= 5 DO Count ← Count + 1 ENDWHILE
Hint: Type the single keyword that marks the end of the loop, in upper case.
5. IF Age >= 18 THEN OUTPUT "Adult" ENDIF
Hint: Type the keyword that displays a value to the user, in upper case.

Spot the Error

Question 1
A DECLARE Score : INTEGER
B INPUT Score
C IF Score >= 50 THEN
D output "Pass"
E ENDIF
Line D — OUTPUT is a keyword, so it must be written in upper case. Lower-case output is a presentation error. The line should be OUTPUT "Pass".
Question 2
A Lives ← 3
B WHILE Lives > 0 DO
C Output Lives
D Lives ← Lives - 1
E ENDWHILE
Line C — Every letter of a keyword must be upper case. Output with a capital O and lower-case letters is wrong. It should be OUTPUT Lives.
Question 3
A INPUT Mark
B if Mark > 49 THEN
C OUTPUT "Pass"
D ENDIF
Line B — The keyword IF must be in upper case. The lower-case if is a presentation error. It should be IF Mark > 49 THEN.
Question 4
A INPUT Number
B OUTPUT ← Number * 2
C OUTPUT Result
Line B — OUTPUT is a keyword, so it can never be used as an identifier name. The variable needs a different name, such as Result ← Number * 2.
Question 5
A for Count ← 1 TO 5
B OUTPUT Count
C NEXT Count
Line A — FOR is a keyword and must be written in upper case. The line should be FOR Count ← 1 TO 5.

Student with a class code? Join your class →