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 questionQuestion
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
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
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 ENDSUBROUTINESubroutine 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.
Tracing Outputs for testSub(10)
"Complete the table to show the values output." [2 marks]
📐 Step-by-Step Execution Trace
- Input: The parameter number receives the value 10 .
- Line 2: OUTPUT number prints 10 .
- Line 3: x ← 10 MOD 2 . Since 10 divided by 2 is 5 with remainder 0, x becomes 0 .
- 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 .
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.
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.
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:
- "Code is broken into subroutines / modules"
- "Uses local variables / parameters"
These features stop code from becoming an unreadable "spaghetti" mess and make large software projects manageable.
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.