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.

Host this setFree Play

The 20 questions

  1. What is a named block of code that carries out a task without returning data?

    • A procedure
    • A function
    • A data type
    • A variable
  2. What does a programming function give back when it finishes?

    • A loop counter
    • A value
    • A variable name
    • An error log
  3. Python defines the function def double(n): return n * 2. What does double(5) give?

    • 25
    • 10
    • 7
    • 5
  4. What is the term for a value passed into a procedure or function?

    • A constant
    • An operator
    • A pointer
    • A parameter
  5. What is the main benefit of using procedures in computer programming?

    • Code reuse
    • Faster compilation
    • Smaller file size
    • Hardware acceleration
  6. What is the key difference between a procedure and a function?

    • Runs more slowly
    • Cannot be called
    • Takes no parameters
    • Returns a value
  7. A function called area takes width and height and returns width times height. What does area(3, 4) return?

    • 12
    • 1
    • 34
    • 7
  8. Which is a good name for a procedure that draws a square?

    • x1
    • draw_square
    • thing2
    • stuff
  9. What occurs when a programming procedure is called?

    • Memory is deleted
    • Instructions are executed
    • Variables are cleared
    • Values are returned
  10. A function is given the list [2, 4, 6] and returns the total of its items. What is returned?

    • 6
    • 3
    • 12
    • 24
  11. Why should a function have a single clear purpose?

    • Easier to maintain
    • Uses less memory
    • Eliminates all bugs
    • Runs much faster
  12. A procedure is called three times. How many times are its instructions carried out?

    • Once
    • Three times
    • Zero times
    • Nine times
  13. What default value does a Python function return without a return statement?

    • None
    • False
    • Null
    • Zero
  14. A function is defined as def add(a, b): return a + b. What is add(2, 9)?

    • 2
    • 7
    • 29
    • 11
  15. 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
  16. What is the primary purpose of giving a function a name?

    • Memory allocation
    • Data encryption
    • Identification for calling
    • Syntax highlighting
  17. Which term describes a reusable code block like play_sound in a game?

    • Variable
    • Integer
    • Constant
    • Procedure
  18. A function calculates the average of a list. What does it output?

    • The list length
    • The calculated average
    • The maximum value
    • The input list
  19. What term describes procedures and functions when used to construct larger programs?

    • Data structures
    • Syntax errors
    • Global variables
    • Building blocks
  20. A procedure that prints Well done is called twice. How many times is it output?

    • Printed twice
    • Printed four times
    • Printed once
    • Not printed

All KS3 Computing quizzes