AQA GCSE Computer Science June 2025 Paper 1, Question 7: reading a subroutine

AQA 8525 June 2025 Paper 1, Question 7: say what a pseudo-code subroutine does, give its outputs for testSub(10), the value returned by testSub(8), its parameter, and two features of the structured approach. Worked through, with the subroutine to run.

Past paper questionAQA 8525/1BJune 2025 Paper 17 marksRead the code

Question 7 of the AQA GCSE Computer Science Paper 1 sat on 12 May 2025 (8525/1B, the Python paper) is 7 marks of short answers about one pseudo-code subroutine. It tests whether you can tell output from return.

We do not copy the exam paper here. Open it beside this page: AQA June 2025 Paper 1B question paper (PDF). When you have finished, check the mark scheme too.

The question in short

testSub(number) outputs number. It sets x to number MOD 2 and outputs x. Then, if x is 0 it returns True, and otherwise it returns False.

The five parts

7.1 Its purpose. To work out whether a number is even. It returns True for an even number and False for an odd one. MOD 2 gives the remainder after dividing by 2, and an even number leaves 0.

7.2 The outputs for testSub(10). OUTPUT number shows 10. Then x is 10 MOD 2, which is 0, so OUTPUT x shows 0.

7.3 The value returned by testSub(8). 8 MOD 2 is 0, so it returns True.

7.4 The identifier of the parameter. number. x is a local variable, not a parameter, and testSub is the name of the subroutine.

7.5 Two characteristics of the structured approach. Any two: the program is broken into subroutines (modules); they take parameters; they give back return values; they use local variables; the code is built from sequence, selection and iteration; the interfaces are well documented.

Where the marks are lost

  • "It outputs a number and its remainder" for 7.1. That describes the lines. The purpose is what it is for: testing for even.
  • True in the output table for 7.2. True is returned, not output. Only 10 and 0 are output.
  • 0 for 7.3. 0 is the value of x. The subroutine returns a Boolean.
  • x for 7.4. The parameter is the name in the brackets of the heading.
  • "It is easier to read" for 7.5. That is an advantage, not a characteristic. Say what a structured program has.

Run it

The subroutine in Python. What it prints and what it returns are shown separately. The robot's light is green for even and blue for odd.

testSub(10) outputs 10 and 0, and returns True. Try 7: it outputs 7 and 1, and returns False.
The program
from bugbot import *
connect()

def testSub(number):
    print("OUTPUT", number)
    x = number % 2
    print("OUTPUT", x)
    if x == 0:
        return True
    else:
        return False

value = int(input("Call testSub with: "))
result = testSub(value)
print("RETURNED", result)
if result:
    led("green")
else:
    led("blue")
Put this demo on your own site

Paste it into a school website, Moodle, Google Sites or a blog. More options on the embed page.

Questions

What are the answers to AQA GCSE Computer Science 2025 Paper 1 Question 7?

7.1: it determines whether a number is even. 7.2: 10, then 0. 7.3: True. 7.4: number. 7.5: any two of subroutines, parameters, return values, local variables.

What is the difference between OUTPUT and RETURN?

OUTPUT displays a value to the user. RETURN passes a value back to the code that called the subroutine, and ends the subroutine. A returned value is not shown unless the calling code outputs it.

What is the structured approach to programming?

Breaking a program into subroutines, each with a clear interface of parameters and return values, using local variables, and building the code from sequence, selection and iteration.

More from this paper

Every AQA 8525 question we have worked

Learn it step by step

  1. F4.2 Parameters and return values Functions and structured code
  2. F4.4 Decomposition and abstraction Functions and structured code
  3. F1.9 Arithmetic operators Programming basics
Open the lessons

This is our own explanation of a published exam question. It is not written or endorsed by AQA, and the question paper and mark scheme remain AQA's copyright. Read them on AQA's site with the links on this page.