Lesson 4.1.1.10

4.1.1.10 Subroutines Quiz: AQA Computer Science, Unit 1

20 questions

In partnership with Revision Ninja

Lesson 4.1.1.10, Subroutines: 20 multiple choice questions for the AQA Computer Science (7517), Unit 1: Fundamentals of 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 out-of-line block of code executed by writing its name?

    • Data type
    • Subroutine
    • Variable
    • Operator
  2. Which of the following is a key advantage of using subroutines in programming?

    • Code reusability
    • Automatic encryption
    • Faster compilation
    • Reduced RAM usage
  3. What key feature distinguishes a function from a procedure?

    • Returns a value
    • Takes parameters
    • Runs out-of-line
    • Modifies global data
  4. What is a main benefit of placing repeated code inside a subroutine?

    • Reduced RAM usage
    • Faster execution speed
    • Automatic bug removal
    • Code reusability
  5. How many times is a subroutine's code stored in memory regardless of call frequency?

    • Every call location
    • Twice
    • In every variable
    • Once
  6. What data structure manages subroutine return addresses and local variables during execution?

    • Queue
    • Heap
    • Symbol table
    • Call stack
  7. Which design technique breaks a complex problem down into smaller subroutines?

    • Decomposition
    • Inheritance
    • Polymorphism
    • Encapsulation
  8. Why are subroutines described as being out-of-line code?

    • Executed automatically
    • Compiled separately
    • Stored separately
    • Defined globally
  9. A subroutine is called multiple times to return different values. What feature does this demonstrate?

    • Method overloading
    • Recursion
    • Global scoping
    • Code reuse
  10. What design process involves breaking down a problem into subroutines?

    • Error handling
    • Sequence iteration
    • Functional decomposition
    • Data abstraction
  11. What is the main benefit of using a subroutine for VAT calculation?

    • Faster calculations
    • Smaller data types
    • Higher precision
    • Easier maintenance
  12. What happens to a defined subroutine if it is never called?

    • Causes runtime error
    • Triggers an exception
    • Never executed
    • Executes automatically
  13. What is the main benefit of using a subroutine for shared validation logic?

    • Increases execution speed
    • Reduces variable scope
    • Improves encryption
    • Prevents code duplication
  14. Which term describes a subroutine that is defined inside another subroutine or program and only used there?

    • Nested subroutine
    • Global constant
    • Record field
    • Pointer variable
  15. What component should implement a distinct menu option task in structured programming?

    • Global variable
    • Constant
    • Data structure
    • Subroutine
  16. What is the main benefit of giving a subroutine a descriptive identifier?

    • Increases execution speed
    • Improves code readability
    • Decreases memory usage
    • Prevents runtime errors
  17. A subroutine call appears inside a loop that runs 100 times. How many times is the subroutine executed?

    • 100
    • 10
    • 0
    • 1
  18. Which testing advantage is gained by dividing code into subroutines?

    • Modular testing
    • Compiler optimisation
    • Syntax checking
    • Automated testing
  19. What is stored on the call stack so execution can resume correctly after a subroutine finishes?

    • Frame pointer
    • Global variable
    • Local variable
    • Return address
  20. How should a flexible subroutine handle variable inputs like line length?

    • Via parameters
    • Hardcoding values
    • Using global variables
    • Via return values

All AQA Computer Science quizzes