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 question

Question

Question 01 contains Figure 1 showing an 8-line Python program: Line 1: '# Python program', Line 2: 'a = 1', Line 3: 'b = 1', Line 4: 'c = 5', Line 5: 'while b < c:', Line 6: '    a = a + a', Line 7: '    b = b + 1', Line 8: '    print(a)'. Subquestion 01.1 asks where an arithmetic operation is first used (options A: Line 1, B: Line 5, C: Line 6, D: Line 8). Subquestion 01.2 asks for the false statement about the program (A: contains a comment, B: uses assignment, C: uses concatenation, D: uses iteration). Subquestion 01.3 asks to state the relational operator used in Figure 1. Subquestion 01.4 asks to complete a trace table with columns for a, b, c, and Output.
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 Mark scheme for Question 01: Part 1 gives 1 mark for C (Line number 6). Part 2 gives 1 mark for C (This program uses concatenation). Part 3 gives 1 mark for '<' or 'Less than'. Part 4 gives 4 marks: MP1 for initial values a=1, b=1, c=5; MP2 for first output 2; MP3 for subsequent values of a (2, 4, 8, 16) and corresponding outputs (2, 4, 8, 16); MP4 for remaining values of b (2, 3, 4, 5).

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

WHAT THIS QUESTION TESTS

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)

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)
QUESTION 01.1

First Use of an Arithmetic Operation

Identifying arithmetic operations in Python source code (1 Mark)

✅ Correct Answer

C – Line number 6

Mark scheme: 1 mark for shading lozenge C only.

💡 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.

QUESTION 01.2

Identifying False Programming Statements

Recognising programming concepts: iteration, assignment, concatenation, and comments (1 Mark)

✅ Correct Answer

C – This program uses concatenation.

Mark scheme: 1 mark for shading lozenge C only.

💡 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.

QUESTION 01.3

Relational Operators

Identifying comparison symbols in selection or iteration conditions (1 Mark)

✅ Acceptable Answers

  • <
  • Less than
Mark scheme: 1 mark for either the symbol < or the phrase "less than". Reject = .

💡 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.

QUESTION 01.4

Completing the Trace Table

Step-by-step variable dry run and output tracking (4 Marks)

📐 Step-by-Step Code Walkthrough

  1. Initialisation (Lines 2–4): Variable values are set before the loop starts: a = 1 , b = 1 , c = 5 .
  2. 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
  3. 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
  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
  5. 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
  6. 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
Mark Breakdown (4 Marks total, max 3 if any errors):
  • 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.