← IGCSE Computer Science Paper 2

Defining a procedure with no parameters

Starts a procedure with no parameters: the keyword PROCEDURE, then its name with no brackets. Indented statements follow, and ENDPROCEDURE closes it.

Understanding Defining a procedure with no parameters in IGCSE Computer Science Paper 2

What it does: The OUTPUT statements are indented between PROCEDURE and ENDPROCEDURE, which shows they belong to the procedure body. With no parameters, the header is just PROCEDURE and the name, so PrintLine has no brackets after it. A procedure must finish with ENDPROCEDURE. A plain END is not the correct closing keyword. Every PROCEDURE needs a matching ENDPROCEDURE. Without it the definition is not finished.

Common mistakes: A procedure must be closed with ENDPROCEDURE. ENDFUNCTION closes a FUNCTION, so the keywords do not match. The keyword PROCEDURE must come first, followed by the name. It should be PROCEDURE Greet.

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 399–408) and word search (Modules 399–418).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line correctly starts a procedure called ShowMenu that has no parameters?
PROCEDURE ShowMenu()PROCEDURE ShowMenu
Matches
PROCEDURE ShowMenu OUTPUT "1. Play" OUTPUT "2. Quit"
↓
ENDPROCEDURE is missing, so the procedure is never closed. Add ENDPROCEDURE on the last line.
Applying
Meanings
Term
PROCEDURE ShowMenu
Meaning
Starts a procedure with no parameters: the keyword PROCEDURE, then its name with no brackets. Indented statements follow, and ENDPROCEDURE closes it.
Practice
PROCEDURE ShowMenu
Testing
Gaps
ShowMenu
Check Answer
Spots
3 OUTPUT "2. Quit"
4ENDFUNCTION

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

The 'Red Panda' badge — Forest Explorer, 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 correctly starts a procedure called ShowMenu that has no parameters?
A. PROCEDURE ShowMenu()
B. PROCEDURE ShowMenu ✓
In Cambridge pseudocode, a procedure with no parameters is written with just PROCEDURE and its name. No brackets are used.
2. Which keyword closes a procedure definition?
A. ENDPROCEDURE ✓
B. END
A procedure must finish with ENDPROCEDURE. A plain END is not the correct closing keyword.
3. Which procedure is written correctly?
A. PROCEDURE SayHello OUTPUT "Hello" ENDPROCEDURE ✓
B. PROCEDURE SayHello OUTPUT "Hello"
Every PROCEDURE needs a matching ENDPROCEDURE. Without it the definition is not finished.
4. Where should the statements inside a procedure go?
A. Indented, between the PROCEDURE line and ENDPROCEDURE ✓
B. Before the PROCEDURE line, not indented
The body of the procedure sits between PROCEDURE and ENDPROCEDURE, and it is indented so it is easy to read.
5. A procedure has no parameters. Which header is right?
A. PROCEDURE PrintLine()
B. PROCEDURE PrintLine ✓
With no parameters there are no brackets in the header. Brackets only appear when there are parameters to list.

Match the Pairs

PROCEDURE ShowMenu → Starts a procedure with no parameters: the keyword PROCEDURE and then the name, with no brackets
ENDPROCEDURE → Closes the procedure definition after the indented statements in its body
The statements in the body of a procedure are indented under the PROCEDURE line → PROCEDURE ShowMenu OUTPUT "1. Play" OUTPUT "2. Quit" ENDPROCEDURE
A procedure with no parameters is named without brackets after PROCEDURE → PROCEDURE PrintLine
PROCEDURE ShowMenu OUTPUT "1. Play" OUTPUT "2. Quit" → ENDPROCEDURE is missing, so the procedure is never closed. Add ENDPROCEDURE on the last line.
PROCEDURE ShowMenu() → Brackets were added although there are no parameters. The header should be PROCEDURE ShowMenu.

Key Term

PROCEDURE ShowMenu
Starts a procedure with no parameters: the keyword PROCEDURE, then its name with no brackets. Indented statements follow, and ENDPROCEDURE closes it.

Fill in the Blanks

1. PROCEDURE ShowMenu OUTPUT "1. Play" ENDPROCEDURE
Hint: Type the keyword that starts the definition of a procedure.
2. PROCEDURE Greet OUTPUT "Hello" ENDPROCEDURE
Hint: Type the keyword that closes the procedure definition.
3. PROCEDURE PrintLine OUTPUT "-----" ENDPROCEDURE
Hint: Type the keyword that displays a value to the screen inside the body.
4. PROCEDURE ShowMenu OUTPUT "Menu" ENDPROCEDURE
Hint: Type the Pascal case identifier for a procedure that shows a menu, with no brackets after it.
5. PROCEDURE AskName INPUT Name ENDPROCEDURE
Hint: Type the keyword that reads a value typed by the user into the variable.

Spot the Error

Question 1
A PROCEDURE ShowMenu
B OUTPUT "1. Play"
C OUTPUT "2. Quit"
D ENDFUNCTION
Line D — A procedure must be closed with ENDPROCEDURE. ENDFUNCTION closes a FUNCTION, so the keywords do not match.
Question 2
A // Greets the player
B Greet PROCEDURE
C OUTPUT "Hi"
D ENDPROCEDURE
Line B — The keyword PROCEDURE must come first, followed by the name. It should be PROCEDURE Greet.
Question 3
A PROCEDURE ShowScore
B Score ← 10
C RETURN Score
D ENDPROCEDURE
Line C — A procedure does not return a value, so RETURN does not belong in it. The line should be OUTPUT Score.
Question 4
A PROCEDURE PrintBorder
B OUTPUT "*****"
C OUTPUT "*****"
D ENDPROC
Line D — The closing keyword is spelled in full: ENDPROCEDURE. ENDPROC is not a keyword.
Question 5
A // Show the menu
B PROCEDURE ShowMenu()
C OUTPUT "1. Play"
D ENDPROCEDURE
Line B — A procedure with no parameters is written without brackets. It should be PROCEDURE ShowMenu.

Student with a class code? Join your class →