AQA GCSE Computer Science Paper 1 (1A), June 2025: Question 1
7 marks · Medium difficulty · Trace Table
Analyse a C# program containing a while loop by identifying an arithmetic operation, false statement, relational operator, and completing a trace table.
Practise this questionQuestion
Question text
01 Figure 1 shows a program written in C#.
• Line numbers are included but are not part of the program.
Figure 1
1 // C# program
2 int a = 1;
3 int b = 1;
4 int c = 5;
5 while (b < c) {
6 a = a + a;
7 b = b + 1;
8 Console.WriteLine(a);
9 }
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
AQA GCSE Computer Science: Code Analysis & Trace Tables
This question evaluates your foundational programming understanding in C# (or pseudocode equivalent), focusing on:
- Identifying programming concepts: arithmetic operators, assignment, comments, iteration, and concatenation.
- Relational operators: identifying comparison symbols used within selection and iteration conditions.
- Dry-running code: accurately executing a while loop step-by-step and completing a trace table with variable states and console outputs.
Reference Code (Figure 1)
Question 01.1: Identifying Arithmetic Operations
✅ Correct Answer
C – Line number 6
💡 Key Knowledge
An arithmetic operation performs mathematical calculation (such as + , - , * , / , MOD , DIV ).
- Line 2, 3, 4 use = which is an assignment operator.
- Line 5 uses < which is a relational operator.
- Line 6 uses + in a + a , making it the first arithmetic operation.
❌ Common Errors
- Confusing the assignment operator = on lines 2–4 with arithmetic.
- Confusing the comparison operator < on line 5 with arithmetic.
Question 01.2: Program Terminology & False Statements
✅ Correct Answer
C – This program uses concatenation.
This statement is false because there is no string concatenation (joining strings together) anywhere in the program.
💡 Evaluating All Options
- A is true: Line 1 contains a comment ( // C# program ).
- B is true: Lines 2, 3, 4, 6, 7 all assign values using = .
- C is FALSE: There are no strings being joined together.
- D is true: Lines 5–9 form a while loop (iteration).
🧠 Exam Technique
Read the question carefully: it asks for the false statement. Underline words like false, not, or incorrect to prevent accidentally picking a true feature of the code.
Question 01.3: Relational Operators
✅ Acceptable Answers
- <
- Less than
💡 Relational vs Assignment
Relational (comparison) operators compare two values and produce a boolean result ( true or false ). Standard relational operators include:
< , > , == , != , <= , >=
In Figure 1, the condition is b < c , so the relational operator is < .
❌ Common Errors
Reject: =
In C#, a single equals sign = is an assignment operator, not a relational operator. Writing = scores 0 marks.
Question 01.4: Completing the Trace Table
📐 Step-by-Step Code Execution
- Initialisation (Lines 2–4): a = 1 , b = 1 , c = 5 . (No output yet).
- Iteration 1: Check condition b < c (1 < 5 → True)
• Line 6: a = 1 + 1 = 2
• Line 7: b = 1 + 1 = 2
• Line 8: Output is 2 - Iteration 2: Check condition b < c (2 < 5 → True)
• Line 6: a = 2 + 2 = 4
• Line 7: b = 2 + 1 = 3
• Line 8: Output is 4 - Iteration 3: Check condition b < c (3 < 5 → True)
• Line 6: a = 4 + 4 = 8
• Line 7: b = 3 + 1 = 4
• Line 8: Output is 8 - Iteration 4: Check condition b < c (4 < 5 → True)
• Line 6: a = 8 + 8 = 16
• Line 7: b = 4 + 1 = 5
• Line 8: Output is 16 - Loop Termination: Check condition b < c (5 < 5 → False). Loop terminates.
✅ 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)
- MP1: Correct initial values for a (1), b (1), and c (5).
- MP2: First output correct ( 2 ).
- MP3: Rest of column a (4, 8, 16) and rest of Output (4, 8, 16) correct with no trailing extra values.
- MP4: Rest of column b (2, 3, 4, 5) correct with no other values.
❌ Common Trace Table Traps
- Off-by-one loop error: Continuing the loop when b = 5 . Remember, 5 < 5 is false, so the loop stops immediately!
- Missing the final value of b: Line 7 increments b to 5 inside the loop before checking the condition again, so 5 must be in column b .
- Writing output too early: Output happens on line 8 after a has already doubled to 2. Do not write 1 in the Output column.
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 (1A), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.