AQA GCSE Computer Science Paper 1 (1B), June 2025: Question 1
7 marks · Medium difficulty · Trace Table
Analyse a Python while-loop program, identifying arithmetic and relational operations, determining false statements about code features, and completing a trace table.
Practise this questionQuestion
Question text
01 Figure 1 shows a program written in Python.
• Line numbers are included but are not part of the program.
Figure 1
1 # Python program
2 a = 1
3 b = 1
4 c = 5
5 while b < c:
6 a = a + a
7 b = b + 1
8 print(a)
01.1 Where is an arithmetic operation first used in the program in Figure 1?
Shade one lozenge.
[1 mark]
A Line number 1
B Line number 5
C Line number 6
D Line number 8
01.2 Which of the following is a false statement about the program in Figure 1?
Shade one lozenge.
[1 mark]
A This program contains a comment.
B This program uses assignment.
C This program uses concatenation.
D This program uses iteration. 3
01.3 State the relational operator used in the program in Figure 1.
[1 mark]
01.4 Complete the trace table for the program in Figure 1.
You may not need to use all the rows in the table.
[4 marks]
a b c Output
Mark scheme
Show the mark scheme
Total
Question Part Marking guidance
marks
01 1 Mark is for AO2 (apply) 1
C Line number 6;
R. If more than one lozenge shaded
Total
Question Part Marking guidance
marks
01 2 Mark is for AO2 (apply) 1
C This program uses concatenation;
R. If more than one lozenge shaded
Total
Question Part Marking guidance
marks
01 3 Mark is for AO2 (apply) 1
<;
//
Less than;
R. =
Total
Question Part Marking guidance
marks
01 4 4 marks for AO2 (apply) 4
MP1: for the first value of column a and the first value of column b and the
first value of column c all correct;
MP2: for the correct first output (2);
MP3: for the rest of column a correct and the rest of the Output column
correct and neither containing any other values at the bottom of the
columns;
MP4: for the rest of column b correct and containing no other values;
Maximum 3 marks if any errors.
I. Different rows used as long as the order within columns is clear
I. Duplicate values on consecutive rows within a column
How to answer it
Python Syntax, Operators & Trace Tables
This question assesses your foundational programming literacy in Python: identifying arithmetic operators versus relational operators, distinguishing key programming constructs (comments, assignments, iteration, string concatenation), and meticulously following code execution using a trace table.
Reference Program (Figure 1)
2 a = 1
3 b = 1
4 c = 5
5 while b < c:
6 a = a + a
7 b = b + 1
8 print (a)
First Use of an Arithmetic Operation
Identifying arithmetic operations in Python source code (1 Mark)
✅ Correct Answer
C – Line number 6
💡 Key Knowledge
- Arithmetic operators perform mathematical calculations: + (addition), - (subtraction), * (multiplication), / (division).
- Line 6 contains a + a , which is the very first addition calculation in the program.
❌ Common Errors
- Confusing assignment with arithmetic: Selecting lines 2, 3, or 4 because they contain = . The single equals sign is an assignment operator, not an arithmetic operation.
- Confusing relational with arithmetic: Selecting line 5 because it has < , which is a relational (comparison) operator.
🧠 Exam Technique
Read the question carefully for the word first. While line 7 also uses an arithmetic operation ( b + 1 ), line 6 executes first.
Identifying False Programming Statements
Recognising programming concepts: iteration, assignment, concatenation, and comments (1 Mark)
✅ Correct Answer
C – This program uses concatenation.
💡 Why the other statements are true
- A is TRUE: Line 1 begins with # , which defines a comment.
- B is TRUE: Lines 2, 3, 4, 6, and 7 use = to assign values to variables.
- D is TRUE: Line 5 uses a while loop, which is an iteration (repetition) structure.
❌ Common Traps
Concatenation vs. Addition: + is used for concatenation only when joining strings (e.g. "Hello" + "World" ). Here, a and b are integers, so + performs integer addition, not concatenation.
🧠 Exam Technique
When an exam question asks for a false statement, write "T" or "F" beside each option in your question paper to prevent accidentally selecting a true statement.
Relational Operators
Identifying comparison symbols in selection or iteration conditions (1 Mark)
✅ Acceptable Answers
- <
- Less than
💡 What is a Relational Operator?
A relational (or comparison) operator compares two operands and returns a boolean value ( True or False ):
- < (less than) — used on line 5: b < c
- > (greater than)
- == (equal to)
- != (not equal to)
- <= and >= (less than / greater than or equal to)
❌ What the Examiner Rejects
Do not write = . A single equals sign is an assignment operator, not a relational operator.
Completing the Trace Table
Step-by-step variable dry run and output tracking (4 Marks)
📐 Step-by-Step Code Walkthrough
- Initialisation (Lines 2–4): Variable values are set before the loop starts: a = 1 , b = 1 , c = 5 .
- Iteration 1: Condition b < c is 1 < 5 (True).
Line 6: a = 1 + 1 = 2
Line 7: b = 1 + 1 = 2
Line 8: Outputs 2 - Iteration 2: Condition b < c is 2 < 5 (True).
Line 6: a = 2 + 2 = 4
Line 7: b = 2 + 1 = 3
Line 8: Outputs 4 - Iteration 3: Condition b < c is 3 < 5 (True).
Line 6: a = 4 + 4 = 8
Line 7: b = 3 + 1 = 4
Line 8: Outputs 8 - Iteration 4: Condition b < c is 4 < 5 (True).
Line 6: a = 8 + 8 = 16
Line 7: b = 4 + 1 = 5
Line 8: Outputs 16 - Loop Termination: Condition b < c is 5 < 5 (False). The loop terminates. Nothing more is executed.
✅ Completed Trace Table
| a | b | c | Output |
|---|---|---|---|
| 1 | 1 | 5 | |
| 2 | 2 | 2 | |
| 4 | 3 | 4 | |
| 8 | 4 | 8 | |
| 16 | 5 | 16 |
- MP1: Initial values correct: first value of a = 1 , b = 1 , and c = 5 .
- MP2: Correct first output value of 2 .
- MP3: Rest of column a ( 4, 8, 16 ) and rest of Output ( 4, 8, 16 ) correct, with no extra values below.
- MP4: Rest of column b correct ( 2, 3, 4, 5 ) with no extra values below.
❌ Common Errors on Trace Tables
- Off-by-one loop error: Continuing the loop when b = 5 . Because 5 < 5 is False, the loop stops immediately! Adding row 32, 6, 32 loses marks.
- Prematurely outputting 1: Outputting 1 on row 1 before print(a) is reached. Line 8 is indented inside the loop, so nothing prints until after line 6 and line 7 have executed.
- Overwriting unchanged columns: You do not need to repeatedly rewrite 5 in column c because c never changes.
🧠 Top Exam Technique
- Execute strictly line-by-line in chronological order. Never guess what a loop does mathematically; trace each instruction.
- Note indentation: line 8 is inside the while loop, meaning print(a) runs on every iteration, not just at the end.
Topics
3.1 Fundamentals of algorithms · 3.2 Programming · 3.1.1 Representing algorithms · 3.2.2 Programming concepts · 3.2.3 Arithmetic operations in a programming language · 3.2.4 Relational operations in a programming language
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.