← QCE Digital Solutions Unit 1

Calling a function

Calling a function by writing its name followed by arguments in brackets, running its instructions and possibly producing a value

Understanding Calling a function in QCE Digital Solutions Unit 1

What it does: This description matches calling a function, which runs its defined instructions. A function call is written as the function name followed by its arguments in brackets, like addNumbers(3, 4). Function calls can appear inside the body of another function or the main algorithm. This line calls addNumbers and stores its returned value in the variable total.

Common mistakes: Calling a function requires brackets around the arguments, such as addNumbers(3, 4). Calling a function requires brackets around the arguments, such as addNumbers(3, 4).

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 158–380) and word search (Modules 82–380).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Does calling a function require its name followed by brackets containing arguments?
TrueFalse
Matches
total <- addNumbers 3, 4
↓
Calling a function requires brackets around its arguments
Applying
Meanings
Term
addNumbers(3, 4)
Meaning
Calling a function by writing its name followed by arguments in brackets, running its instructions and possibly producing a value
Practice
define addNumbers(a, b)
Testing
Gaps
total ← (3, 4)
Check Answer
Spots
3end function
4total <- addNumbers 3, 4

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

The 'Leopard' badge — Savannah Perfectionist, 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. Does calling a function require its name followed by brackets containing arguments?
A. True ✓
B. False
A function call is written as the function name followed by its arguments in brackets, like addNumbers(3, 4).
2. Should arguments in a function call be separated by commas?
A. False
B. True ✓
Multiple arguments in a function call are separated by commas, such as multiply(3, 4).
3. Can the value returned by a function call be stored in a variable?
A. True ✓
B. False
A function call's returned value can be assigned to a variable, such as total ← addNumbers(3, 4).
4. Should a function call with no arguments still include empty brackets?
A. False
B. True ✓
Even with no arguments, a function call still needs brackets, such as showMenu().
5. Does a function call need to use square brackets, like myFunc[3, 4]?
A. False ✓
B. True
Function calls use round brackets, not square brackets, for their arguments.

Match the Pairs

addNumbers(3, 4) → Calls the addNumbers function with two arguments
total ← addNumbers(3, 4) → Stores the value returned by a function call in a variable
Writing a function's name followed by arguments in brackets → Calling a function
Values passed into a function call, matching the parameters it expects → (3, 4)
total <- addNumbers 3, 4 → Calling a function requires brackets around its arguments
size ← area[5, 3] → A function call uses round brackets, not square brackets

Key Term

addNumbers(3, 4)
Calling a function by writing its name followed by arguments in brackets, running its instructions and possibly producing a value

Fill in the Blanks

1. total ← addNumbers(3, 4)
Hint: Type the name of the function being called
2. total ← addNumbers(3, 4)
Hint: Type the first argument passed to the function
3. result ← multiply(6, 7)
Hint: Type the second argument passed to the function
4. message ← greet("Sam")
Hint: Type the argument being passed to the greet function, without quotes
5. DISPLAY addNumbers(2, 5)
Hint: Type the second argument passed to the function

Spot the Error

Question 1
A define addNumbers(a, b)
B return a + b
C end function
D total <- addNumbers 3, 4
Line D — Calling a function requires brackets around the arguments, such as addNumbers(3, 4).
Question 2
A total <- addNumbers 3, 4
B define addNumbers(a, b)
C return a + b
D end function
Line A — Calling a function requires brackets around the arguments, such as addNumbers(3, 4).
Question 3
A define double(n)
B return n * 2
C end function
D output = double(6)
Line D — Assignment in pseudocode uses ←, not =.
Question 4
A define computeArea(length, width)
B size <- computeArea 5, 3
C return length * width
D end function
Line B — Calling a function requires brackets around its arguments — it should read computeArea(5, 3).
Question 5
A define multiply(x, y)
B answer <- multiply(3 4)
C return x * y
D end function
Line B — Arguments in a function call must be separated by a comma, such as multiply(3, 4).

Student with a class code? Join your class →