AQA A-Level Computer Science AS Paper 1, June 2025: Question 4

6 marks · Easy difficulty · Short Answer

Define the term subroutine, state three advantages of using subroutines, and describe how parameters improve their effectiveness.

Practise this question

Question

Question 04 contains three sub-parts: 04.1 asks to define the term subroutine for 1 mark; 04.2 asks to state three advantages of using subroutines for 3 marks; and 04.3 asks to describe how parameters improve the effectiveness of subroutines for 2 marks.
Question text

04.1 Define the term subroutine.

[1 mark]

04.2 State three advantages of using subroutines.

[3 marks]

04.3 Describe how parameters improve the effectiveness of subroutines.

[2 marks]

Mark scheme

Show the mark scheme Mark scheme for Question 04: Part 04.1 awards 1 mark for 'A named/callable (out of line) block of code (that may be executed by writing the name in a program statement)'. Part 04.2 awards up to 3 marks for advantages such as easier to re-use code, easier to understand, easier to debug/maintain/test, less code/faster development, facilitates multiple programmers, reduces side-effects, or enables local variables. Part 04.3 awards up to 2 marks for benefits of parameters, including avoiding global variables, allowing the subroutine to work with different values/expressions, easier code reuse across programs, independent testing, or making data dependencies explicit.

04 1 Mark is for AO1 (knowledge) 1

A named/callable (out of line) block of code (that may be executed by writing the name

in a program statement);

04 2 3 marks for AO1 (understanding) 3

Easier to re-use code;

Easier to understand;

Easier to debug/update/maintain/test;

Easier to develop a solution // supports structured approach;

Less code // faster to develop a solution;

Facilitates multiple programmers working on a program simultaneously;

Reduces/eliminates side-effects;

A. enables use of local variables, which only use memory when subroutine is executing

Max 3

04 3 2 marks for AO1 (understanding) 2

Avoids the use of global variables // makes subroutines self-contained/encapsulated;

Makes it easier to use the subroutine with different values/expressions/variables;

Makes it easier to reuse the subroutine in a different program;

Makes it easier to test the subroutine independently of the rest of the program;

Makes it clearer which values from outside the subroutine are being used inside the

subroutine (as they are explicitly listed);

Max 2

How to answer it

Fundamentals of Programming: Subroutines & Parameters

📋 What this question tests

This question evaluates your foundational understanding of modular programming concepts from AQA Specification Section 3.1 (Aspects of software development):

  • Providing a formal technical definition of a subroutine.
  • Understanding the practical software engineering advantages of modularising code into subroutines.
  • Explaining the purpose, role, and benefits of passing parameters into subroutines.
Question 04.1 [1 Mark]

Defining a Subroutine

Define the term subroutine.

✅ Acceptable Answers (1 Mark)

  • A named / callable (out-of-line) block of code.
  • A self-contained section of code that can be executed by writing its name in a program statement.
Mark scheme note: Award 1 mark for AO1 (knowledge) identifying both that it is a named/callable block of code and/or executed on call.

💡 Key Knowledge

A subroutine is an out-of-line unit of execution. In most high-level languages, subroutines take the form of either:

  • Procedures: execute a set of instructions without returning a direct value to the calling statement.
  • Functions: execute instructions and must return a value back to the call site.

🧠 Exam Technique

Don't be vague. Avoid phrases like "a part of a program" or "a line of code". The essential technical element examiners look for is that it is a named block of instructions that is called / executed when referenced.

❌ Common Errors

  • Confusing a subroutine with a loop or selection statement (e.g. saying "code that repeats until finished").
  • Stating an advantage (e.g. "it saves memory") instead of defining what it actually is.
Question 04.2 [3 Marks]

Advantages of Using Subroutines

State three advantages of using subroutines.

✅ Acceptable Points (Any 3, 1 Mark Each)

  • Code reusability: Easier to re-use code across different parts of the project or future programs.
  • Maintainability & Debugging: Easier to test, debug, update, and maintain isolated units of code.
  • Readability & Structure: Easier to understand; supports a structured, top-down modular approach.
  • Development speed: Write less code / faster to build solutions.
  • Team collaboration: Facilitates multiple programmers working simultaneously on separate modules.
  • Reduced side effects / Memory efficiency: Enables the use of local variables, which only occupy memory while the subroutine executes.

❌ Common Errors & Lost Marks

  • Vague one-word points: Writing just "easier", "faster", or "saves time" without explaining what is easier (e.g., must specify "easier to debug" or "faster development").
  • Repeating the same benefit: Giving "easier to test" and "easier to find bugs" as two separate points—examiners consider these the same marking point.
  • Claiming it makes the program run faster—subroutine calls actually incur a microscopic call-stack overhead; the speed advantage lies in developer productivity.

🧠 Exam Technique: Distinct Categories

To secure all 3 marks reliably, pick benefits from completely different areas:

  1. Teamwork / Management: Allows parallel development by multiple programmers.
  2. Quality / Maintenance: Simplifies unit testing and debugging.
  3. Code efficiency: Reusable code avoids duplication (DRY principle).
Question 04.3 [2 Marks]

How Parameters Improve Effectiveness

Describe how parameters improve the effectiveness of subroutines.

✅ Acceptable Points (Any 2, 1 Mark Each)

  • Eliminates global variables: Makes the subroutine self-contained / encapsulated, reducing unwanted side effects.
  • Flexibility & Reusability: Allows the same subroutine to operate on different values, expressions, or variables each time it is called.
  • Portability: Makes it easier to reuse the subroutine in a completely different program without dependencies.
  • Independent testing: Enables simple isolated unit testing by passing test values directly into arguments.
  • Code clarity: Makes it explicit and clear which inputs from outside the subroutine are being manipulated inside.

💡 Key Knowledge: Parameters vs. Global Variables

Without parameters, a subroutine would either:

  • Always execute using fixed, hard-coded values (inflexible).
  • Rely on global variables, meaning any other routine could accidentally mutate that data, leading to obscure bugs and tight coupling.

Parameters create clean, well-defined interfaces for your code blocks.

🧠 Exam Technique: Focus on the "Improvement"

The command word is describe how parameters improve effectiveness. Don't just define what a parameter is (e.g. "it is a value passed in"). State the direct benefit: "It allows the subroutine to be called with different arguments..." or "It reduces reliance on global variables, making the code self-contained."

❌ Common Errors

  • Confusing parameters (the variable definition in the subroutine header) with arguments (the actual value passed in during the call)—though acceptable in general descriptions, maintaining precise terminology is best practice.
  • Claiming parameters return values—parameters are inputs; return statements deliver outputs.

Topics

4.1 Fundamentals of programming · 4.1.1 Programming

Question and mark scheme from the AQA A-Level Computer Science examination, AS Paper 1, June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.