Year 9 Programming: Understanding Functions
Computer Science
Year 9
12 questions
~24 mins
0 views0 downloads
About This Worksheet
This worksheet focuses on understanding and applying functions in programming. Complete the questions to demonstrate your knowledge of how functions work.
Worksheet Preview
Full preview • 12 questions
Year 9 Programming: Understanding Functions
Subject: Computer ScienceGrade: Year 9
Name:
Date:
TeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizz
Untitled Worksheet
Grade Year 9
A
Questions
This worksheet focuses on understanding and applying functions in programming. Complete the questions to demonstrate your knowledge of how functions work.
Answer all questions in the spaces provided.
1.
Define a function in programming and explain its main purpose.
[4 marks]2.
Write a simple pseudocode for a function named 'addNumbers' that takes two numbers as input and returns their sum.
[5 marks]3.
Describe what happens when a function is called in a program.
[3 marks]4.
Complete the following example of a function in pseudocode that checks if a number is even or odd:
Function checkEvenOdd(number):
If ________:
Output 'Even'
Else:
Output 'Odd'
[4 marks]5.
Explain the difference between a parameter and an argument in the context of functions.
[3 marks]6.
Sketch a flowchart diagram for a function that takes a number as input and outputs whether it is positive, negative, or zero.
[6 marks]Drawing / Sketch space
7.
Draw a logic circuit that represents a function which outputs true only when both input signals are true.
[6 marks]Drawing / Sketch space
8.
Given the following truth table, complete the missing entries:
| Input A | Input B | Output |
|---------|---------|---------|
| 0 | 0 | ? |
| 0 | 1 | ? |
| 1 | 0 | ? |
| 1 | 1 | ? |
[5 marks]| A | B | Output |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
9.
Explain why functions are useful in programming.
[3 marks]10.
Write a function in pseudocode that calculates the area of a rectangle given its length and width.
[5 marks]11.
Describe what is meant by 'calling a function' in programming.
[3 marks]12.
Sketch a diagram illustrating how a function can be called multiple times with different inputs in a program.
[6 marks]Drawing / Sketch space
Quick Actions
What is Remix?
Create a new worksheet based on this one. Change the grade level, topic, number of questions, or difficulty - then generate a fresh version.
- • Change grade level (Grade 6 → Grade 7)
- • Swap topics (Harry Potter → Macbeth)
- • Add more questions (10 → 15)
- • Adjust difficulty
Details
- Created
- 1/2/2026
- Updated
- 1/2/2026
- Type
- worksheet