AQA GCSE Computer Science Paper 1 (1B), June 2025: Question 7

7 marks · Medium difficulty · Short Answer

Analyze a pseudo-code subroutine using MOD to determine if a number is even, trace its outputs, identify its parameter, and state characteristics of structured programming.

Practise this question

Question

Figure 7 displays a pseudo-code subroutine named testSub taking 'number' as a parameter. Inside, it executes: OUTPUT number, x assigned to number MOD 2, OUTPUT x, followed by an IF condition checking if x equals 0, returning True, otherwise returning False. Sub-questions ask to: describe the purpose of the subroutine (1 mark); complete an output table for testSub(10) (2 marks); state the value returned for testSub(8) (1 mark); identify the parameter name (1 mark); and state two characteristics of structured programming (2 marks).
Question text

07 Figure 7 shows a subroutine written in pseudo-code.

Figure 7

SUBROUTINE testSub(number)

OUTPUT number

x number MOD 2

OUTPUT x

IF x = 0 THEN

RETURN True

ELSE

RETURN False

ENDIF

ENDSUBROUTINE

07.1 Describe the purpose of the subroutine in Figure 7.

[1 mark]

07.2 The subroutine in Figure 7 is called using testSub(10)

Complete the table to show the values output.

[2 marks]

Program Code Output

OUTPUT number

OUTPUT x

07.3 The subroutine in Figure 7 is called using testSub(8)

State the value returned.

[1 mark]

07.4 State the identifier for the parameter in Figure 7.

[1 mark]

0 7*.205*State two characteristics of the structured approach to programming.

[2 marks]

Mark scheme

Show the mark scheme Mark scheme for question 07: 07.1 awards 1 mark for stating it determines if a number is odd/even, a multiple of 2, or checks if the remainder of division by 2 is 0. 07.2 awards 2 marks for outputs 10 and 0. 07.3 awards 1 mark for True. 07.4 awards 1 mark for 'number'. 07.5 awards 2 marks for any two characteristics of the structured approach: modularised/broken into subroutines, uses parameters, uses return values, uses local variables, uses selection, uses iteration, or uses well-documented interfaces.

Total

Question Part Marking guidance

marks

07 1 Mark is for AO2 (apply) 1

Maximum of 1 mark from:

● To determine if a number/x is odd/even // To determine if a

number/x is a multiple of 2;

● To return True if a number/x is even // To return False if a

number is odd;

● To return True if a number/x is a multiple of 2 // To return False if

a number/x is not (a multiple of 2);

● To return True if the remainder (of the integer division) is 0 // To

return False if the remainder is 1 / not 0;

Total

Question Part Marking guidance

marks

07 2 2 marks for AO2 (apply) 2

Program Code Output

OUTPUT number 10;

OUTPUT x 0;

Total

Question Part Marking guidance

marks

07 3 Mark is for AO2 (apply) 1

True;

I. Case

Total

Question Part Marking guidance

marks

07 4 Mark is for AO2 (apply) 1

number;

I. Case

Total

Question Part Marking guidance

marks

07 5 2 marks for AO1 (understanding) 2

Maximum of 2 marks from:

● (is) modularised // broken down into sections/chunks // (uses)

subroutines // named/out of line blocks of code;

● (uses) parameters;

● (uses) return values;

● (uses) local variables;

● (uses) selection;

● (uses) iteration;

● (uses) well documented interfaces;

How to answer it

Subroutines, MOD Logic & Structured Programming

📌 What this question tests

This question assesses your ability to trace pseudo-code, understand arithmetic operators (specifically the modulo operator MOD ), distinguish between printed output and returned values, identify subroutine parameters, and recall key principles of structured programming.

Question 07.1

Describe the purpose of the subroutine

Target: AO2 (Apply) | Total: 1 mark

✅ Acceptable Answers (Any 1)

  • To determine if a number is odd or even.
  • To check whether a number is a multiple of 2.
  • Returns True if the number is even, and False if odd.
  • Returns True if the remainder when divided by 2 is 0.

💡 Key Knowledge: The MOD Operator

MOD calculates the integer remainder after division.

  • 10 MOD 2 = 0 (no remainder → even)
  • 11 MOD 2 = 1 (remainder 1 → odd)

Checking if number MOD 2 = 0 is the standard algorithm to test if an integer is even.

❌ Common Errors

Saying simply "it divides the number by 2". Modulo does not divide to give the quotient; it returns the remainder. Always state the overall purpose (checking if it is even/odd).

Mark allocation: 1 mark for clearly identifying the purpose as determining if the number is even/odd or divisible by 2.
Question 07.2

Trace the Subroutine: testSub(10)

Target: AO2 (Apply) | Total: 2 marks

📐 Step-by-Step Execution

  1. Line 1: Argument 10 is passed into parameter number .
  2. Line 2: OUTPUT number prints 10 .
  3. Line 3: Calculate 10 MOD 2 . 10 divided by 2 is 5 remainder 0, so x ← 0 .
  4. Line 4: OUTPUT x prints 0 .

✅ Completed Table

Program Code Output
OUTPUT number 10
OUTPUT x 0

🧠 Exam Technique

Notice the question specifically asks for values output (printed to screen). Do not confuse OUTPUT with RETURN . Even though the subroutine later evaluates an IF statement and returns True , that value is not printed by an OUTPUT statement.

Mark allocation: 1 mark for each correct output value (10 and 0). Maximum 2 marks.
Question 07.3

State the Value Returned: testSub(8)

Target: AO2 (Apply) | Total: 1 mark

✅ Correct Answer

True

(Examiner guidance: Case insensitive, e.g. "true", "TRUE", or "True" are all accepted.)

💡 Tracing the Return Statement

With number = 8 :

  • x = 8 MOD 2 = 0
  • Condition IF x = 0 evaluates to true.
  • The code executes the branch: RETURN True .

❌ Common Errors

Writing the printed outputs (8 or 0) instead of the returned Boolean. Read the command word carefully: "State the value returned".

Mark allocation: 1 mark for True .
Question 07.4

Identifier for the Parameter

Target: AO2 (Apply) | Total: 1 mark

✅ Correct Answer

number

(Examiner guidance: Ignore case.)

💡 Parameter vs Argument

  • Parameter: The named variable inside the subroutine header definition:
    SUBROUTINE testSub(number) .
  • Argument: The actual value passed in during a call, e.g. the 8 in testSub(8) .
  • Identifier: The name given to a variable, subroutine, or parameter.

❌ Common Errors

Writing testSub (which is the subroutine name), or x (which is a local variable), or giving a specific number like 10 .

Mark allocation: 1 mark for identifying number .
Question 07.5

Characteristics of Structured Programming

Target: AO1 (Recall & Understanding) | Total: 2 marks

✅ Acceptable Characteristics (Give any 2)

  • Program code is modularised / broken down into subroutines (functions/procedures).
  • Uses parameters to pass data into blocks.
  • Uses return values to pass data back.
  • Uses local variables (variables accessible only inside their subroutine).
  • Uses standard programming constructs: sequence, selection, and iteration.
  • Avoids unconditional jumps (e.g. no GOTO statements).
  • Uses well-documented interfaces.

🧠 Exam Technique: Two Separate Points

When an exam asks for "two characteristics", make sure your two answers are completely distinct. For example:

  1. Code is divided into smaller subroutines / modules.
  2. Uses local variables rather than global variables.

Do not write "uses functions" for line 1 and "uses procedures" for line 2—they are treated as the same point.

💡 Why use Structured Programming?

Structured programming makes programs easier to read, test, debug, and allows multiple programmers to work on separate modules simultaneously without variable clashes.

Mark allocation: 1 mark for each valid characteristic. Maximum 2 marks.

Topics

3.1 Fundamentals of algorithms · 3.2 Programming · 3.1.1 Representing algorithms · 3.2.3 Arithmetic operations in a programming language · 3.2.10 Structured programming and subroutines (procedures and functions)

Question and mark scheme from the AQA GCSE Computer Science examination, Paper 1 (1B), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.