Lesson T2.3.1
T2.3.1 Procedures and functions Quiz: KS3 Computing, Unit 2
20 questions
In partnership with Revision Ninja
Lesson T2.3.1, Procedures and functions: 20 multiple choice questions for the KS3 Computing (National Curriculum), Unit 2: Programming, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
What is a named block of code that carries out a task without returning data?
- A procedure
- A function
- A data type
- A variable
-
What does a programming function give back when it finishes?
- A loop counter
- A value
- A variable name
- An error log
-
Python defines the function def double(n): return n * 2. What does double(5) give?
- 25
- 10
- 7
- 5
-
What is the term for a value passed into a procedure or function?
- A constant
- An operator
- A pointer
- A parameter
-
What is the main benefit of using procedures in computer programming?
- Code reuse
- Faster compilation
- Smaller file size
- Hardware acceleration
-
What is the key difference between a procedure and a function?
- Runs more slowly
- Cannot be called
- Takes no parameters
- Returns a value
-
A function called area takes width and height and returns width times height. What does area(3, 4) return?
- 12
- 1
- 34
- 7
-
Which is a good name for a procedure that draws a square?
- x1
- draw_square
- thing2
- stuff
-
What occurs when a programming procedure is called?
- Memory is deleted
- Instructions are executed
- Variables are cleared
- Values are returned
-
A function is given the list [2, 4, 6] and returns the total of its items. What is returned?
- 6
- 3
- 12
- 24
-
Why should a function have a single clear purpose?
- Easier to maintain
- Uses less memory
- Eliminates all bugs
- Runs much faster
-
A procedure is called three times. How many times are its instructions carried out?
- Once
- Three times
- Zero times
- Nine times
-
What default value does a Python function return without a return statement?
- None
- False
- Null
- Zero
-
A function is defined as def add(a, b): return a + b. What is add(2, 9)?
- 2
- 7
- 29
- 11
-
Why would a programmer use parameters inside a function?
- To speed up execution
- To store global variables
- To accept different values
- To stop infinite loops
-
What is the primary purpose of giving a function a name?
- Memory allocation
- Data encryption
- Identification for calling
- Syntax highlighting
-
Which term describes a reusable code block like play_sound in a game?
- Variable
- Integer
- Constant
- Procedure
-
A function calculates the average of a list. What does it output?
- The list length
- The calculated average
- The maximum value
- The input list
-
What term describes procedures and functions when used to construct larger programs?
- Data structures
- Syntax errors
- Global variables
- Building blocks
-
A procedure that prints Well done is called twice. How many times is it output?
- Printed twice
- Printed four times
- Printed once
- Not printed
Related quizzes
- Solving problems with two or more programming languages Quiz · T2.1.1 · 20 questions
- Textual programming languages Quiz · T2.1.2 · 20 questions
- Lists, tables and arrays Quiz · T2.2.1 · 20 questions
- Designing and developing modular programs Quiz · T2.3.2 · 20 questions
- Computational abstractions of real-world systems Quiz · T1.1.1 · 20 questions
- AND, OR and NOT Quiz · T3.1.1 · 20 questions
- Hardware and software components Quiz · T4.1.1 · 20 questions
- Combining applications across devices Quiz · T5.1.1 · 20 questions
- Using technology safely, respectfully and responsibly Quiz · T6.1.1 · 20 questions
- Sorting algorithms Quiz · T1.2.1 · 20 questions