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.
The 20 questions
-
What is a named out-of-line block of code executed by writing its name?
- Data type
- Subroutine
- Variable
- Operator
-
Which of the following is a key advantage of using subroutines in programming?
- Code reusability
- Automatic encryption
- Faster compilation
- Reduced RAM usage
-
What key feature distinguishes a function from a procedure?
- Returns a value
- Takes parameters
- Runs out-of-line
- Modifies global data
-
What is a main benefit of placing repeated code inside a subroutine?
- Reduced RAM usage
- Faster execution speed
- Automatic bug removal
- Code reusability
-
How many times is a subroutine's code stored in memory regardless of call frequency?
- Every call location
- Twice
- In every variable
- Once
-
What data structure manages subroutine return addresses and local variables during execution?
- Queue
- Heap
- Symbol table
- Call stack
-
Which design technique breaks a complex problem down into smaller subroutines?
- Decomposition
- Inheritance
- Polymorphism
- Encapsulation
-
Why are subroutines described as being out-of-line code?
- Executed automatically
- Compiled separately
- Stored separately
- Defined globally
-
A subroutine is called multiple times to return different values. What feature does this demonstrate?
- Method overloading
- Recursion
- Global scoping
- Code reuse
-
What design process involves breaking down a problem into subroutines?
- Error handling
- Sequence iteration
- Functional decomposition
- Data abstraction
-
What is the main benefit of using a subroutine for VAT calculation?
- Faster calculations
- Smaller data types
- Higher precision
- Easier maintenance
-
What happens to a defined subroutine if it is never called?
- Causes runtime error
- Triggers an exception
- Never executed
- Executes automatically
-
What is the main benefit of using a subroutine for shared validation logic?
- Increases execution speed
- Reduces variable scope
- Improves encryption
- Prevents code duplication
-
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
-
What component should implement a distinct menu option task in structured programming?
- Global variable
- Constant
- Data structure
- Subroutine
-
What is the main benefit of giving a subroutine a descriptive identifier?
- Increases execution speed
- Improves code readability
- Decreases memory usage
- Prevents runtime errors
-
A subroutine call appears inside a loop that runs 100 times. How many times is the subroutine executed?
- 100
- 10
- 0
- 1
-
Which testing advantage is gained by dividing code into subroutines?
- Modular testing
- Compiler optimisation
- Syntax checking
- Automated testing
-
What is stored on the call stack so execution can resume correctly after a subroutine finishes?
- Frame pointer
- Global variable
- Local variable
- Return address
-
How should a flexible subroutine handle variable inputs like line length?
- Via parameters
- Hardcoding values
- Using global variables
- Via return values
Related quizzes
- Data types Quiz · 4.1.1.1 · 20 questions
- Programming concepts: sequence, selection and iteration Quiz · 4.1.1.2 · 20 questions
- Arithmetic operations Quiz · 4.1.1.3 · 20 questions
- Relational and Boolean operations Quiz · 4.1.1.4 · 20 questions
- Constants and variables Quiz · 4.1.1.6 · 20 questions
- String-handling operations Quiz · 4.1.1.7 · 20 questions
- Random numbers and exception handling Quiz · 4.1.1.8 · 20 questions
- Parameters and returning values Quiz · 4.1.1.11 · 20 questions
- Local and global variables Quiz · 4.1.1.13 · 20 questions
- Stack frames in subroutine calls Quiz · 4.1.1.15 · 20 questions