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

7 marks · Medium difficulty · Short Answer

Analyze a subroutine using the MOD operator to determine even or odd numbers, trace its outputs and return value, identify its parameter, and state characteristics of structured programming.

Practise this question

Question

Question 07 shows pseudo-code for subroutine testSub(number): it outputs number, assigns x as number MOD 2, outputs x, and returns True if x equals 0, else False. Part 07.1 asks to describe the purpose of the subroutine. Part 07.2 asks to complete an output table for testSub(10) with rows for OUTPUT number and OUTPUT x. Part 07.3 asks for the returned value when calling testSub(8). Part 07.4 asks for the identifier for the parameter. Part 07.5 asks to state two characteristics of the structured approach to programming.
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 accepts determining if a number is even/odd or a multiple of 2 (1 mark). 07.2 shows outputs 10 and 0 (2 marks). 07.3 gives True (1 mark). 07.4 gives number (1 mark). 07.5 lists characteristics such as modularised/broken down into subroutines, uses parameters, uses return values, uses local variables, uses selection, uses iteration, or uses well-documented interfaces (2 marks max).

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

Subroutine Tracing & Structured Programming Guide

📌 What this question tests

This question assesses your ability to trace and interpret subroutines written in pseudo-code, as well as recall core theoretical concepts of software development.

  • Modulo arithmetic (MOD): Finding integer remainders after division.
  • Tracing execution: Identifying outputs, return values, and parameters in a subroutine.
  • Structured approach: Key features that make code modular, readable, and maintainable.

Reference 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
Part 07.1

Subroutine Purpose

"Describe the purpose of the subroutine in Figure 7." [1 mark]

✅ Acceptable Answers (Any one)

  • To determine if a number is odd or even.
  • To determine if a number is a multiple of 2.
  • To return True if a number is even / return False if odd.
  • To check whether the remainder after dividing by 2 is 0.

💡 Key Knowledge

MOD 2 calculates the remainder when divided by 2:

  • Any even number MOD 2 = 0
  • Any odd number MOD 2 = 1

Because it checks IF x = 0 , it returns True exclusively for even numbers.

Examiner Insight: Keep it concise! Mentioning either "checks if even/odd" or "checks if divisible by 2" earns the full 1 mark immediately. Avoid simply re-writing the code in words.
Part 07.2

Tracing Outputs for testSub(10)

"Complete the table to show the values output." [2 marks]

📐 Step-by-Step Execution Trace

  1. Input: The parameter number receives the value 10 .
  2. Line 2: OUTPUT number prints 10 .
  3. Line 3: x ← 10 MOD 2 . Since 10 divided by 2 is 5 with remainder 0, x becomes 0 .
  4. Line 4: OUTPUT x prints 0 .

✅ Completed Table

Program Code Output
OUTPUT number 10
OUTPUT x 0

[1 mark for each correct row]

❌ Common Errors

  • Confusing OUTPUT with RETURN : Writing "True" in the table instead of the numeric outputs.
  • Writing the result of division ( 5 ) rather than the remainder ( 0 ) for x .
Part 07.3

Return Value for testSub(8)

"State the value returned." [1 mark]

✅ Correct Answer

True

(Case-insensitive: "true" or "TRUE" is also accepted)

🧠 Exam Technique

Read the question carefully: it asks for the value returned, not printed.

  • 8 MOD 2 = 0
  • Since x = 0 is true, execution branches to RETURN True .
  • Do not write the output numbers ( 8 or 0 ); only state the boolean return value.
Part 07.4

Identifying the Parameter

"State the identifier for the parameter in Figure 7." [1 mark]

✅ Correct Answer

number

(Case-insensitive)

💡 Identifier Terminology

  • Subroutine Name: testSub
  • Parameter: number (the variable inside the header bracket that receives data)
  • Local Variable: x

❌ Common Mistake

Giving the argument used in previous questions (e.g. writing 10 or 8 ) or naming the subroutine itself ( testSub ). A parameter is the variable identifier defined in the header.

Part 07.5

Characteristics of Structured Programming

"State two characteristics of the structured approach to programming." [2 marks]

✅ Correct Answers (Choose any two)

  • Modularised / broken down into subroutines, modules, or chunks.
  • Uses parameters to pass data into blocks.
  • Uses return values to pass data back.
  • Uses local variables (keeping variable scope restricted).
  • Uses selection (e.g. IF statements).
  • Uses iteration (e.g. FOR / WHILE loops).
  • Has clear, well-documented interfaces.

🧠 Exam Technique: Easy Marks to Remember

The easiest two characteristics to recall are:

  1. "Code is broken into subroutines / modules"
  2. "Uses local variables / parameters"

These features stop code from becoming an unreadable "spaghetti" mess and make large software projects manageable.

Marking Scheme Rule: 1 mark per distinct valid point up to a maximum of 2 marks. Avoid vague generalisations like "it is easier to read" without naming a technical characteristic.

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 (1A), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.