AQA GCSE Computer Science Paper 1 (1B), June 2025: Question 5

8 marks · Medium difficulty · Programming

Describe data types, explain why integer rather than string is used for numerical addition, state the Python float type, and rewrite a program to calculate the sum of five numbers using iteration.

Practise this question

Question

Question 5 shows Figure 5 containing a Python program that takes five integer inputs (num1 to num5), adds them together into variable total, and prints total. Question 05.1 asks to describe what is meant by a data type (1 mark). Question 05.2 asks to explain why variables num1 to num5 do not have a string data type (1 mark). Question 05.3 asks to state the Python data type that should be used for numbers with a fractional part (1 mark). Question 05.4 asks to rewrite the program in Python so it achieves the same result using an iteration structure containing only one input() statement, with a code grid provided (5 marks).
Question text

05 The Python program in Figure 5 gets five numbers and outputs the sum of those

numbers.

Figure 5

num1 = int(input())

num2 = int(input())

num3 = int(input())

num4 = int(input())

num5 = int(input())

total = num1 + num2 + num3 + num4 + num5

print(total)

05.1 An integer data type is used in the program in Figure 5.

Describe what is meant by a data type.

[1 mark]

The variables num1, num2, num3, num4 and num5 in Figure 5 have an

integer data type.

05.2 Explain why these variables do not have a string data type.

[1 mark]

05.3 The program in Figure 5 needs to be changed to use numbers with a fractional part

(a real number).

State a data type in Python that should be used.

[1 mark]

05.4 Rewrite the program in Figure 5 so that it achieves the same result but uses an

iteration structure that contains only one input()statement.

Your answer must be written in Python.

You should use indentation as appropriate, meaningful variable name(s) and Python

syntax in your answer.

The answer grid below contains vertical lines to help you indent your code.

[5 marks]

Mark scheme

Show the mark scheme Mark scheme for Question 5. Part 05.1: 1 mark for specifying the type of value/data a variable stores/has, or defining the type of operations that can be performed on a value. Part 05.2: 1 mark for noting that strings would concatenate instead of add, or that arithmetic addition requires numeric types. Part 05.3: 1 mark for 'float'. Part 05.4: 5 marks total (1 design, 4 programming logic): Mark A for iteration structure; Mark B for looping correctly 5 times; Mark C for obtaining user input once inside the loop; Mark D for correctly calculating the running total; Mark E for outputting the total outside the loop.

Total

Question Part Marking guidance

marks

05 1 Mark is for AO1 (recall) 1

(Specifies the) type of value/data a variable stores/has;

R. Information in place of Data

//

Defines the type of operations that can be performed on a value (stored in a

variable);

Total

Question Part Marking guidance

marks

05 2 Mark is for AO2 (apply) 1

The values would be concatenated if they were strings;

//

The values need to be added to the other values;

//

The arithmetic operator can only be used on numeric values;

Total

Question Part Marking guidance

marks

05 3 Mark is for AO2 (apply) 1

C#

Maximum of 1 mark from:

double;

float;

decimal;

Python

float;

VB.NET

Maximum of 1 mark from:

Double;

Single;

A. Decimal;

I. Case

R. Real

Total

Question Part Marking guidance

marks

05 4 1 mark for AO3 (design), 4 marks for AO3 (program) 5

Program Design

Note that AO3 (design) marks are for selecting appropriate techniques to

use to solve the problem, so should be credited whether the syntax of

programming language statements is correct or not and regardless of

whether the solution works.

Mark A for the use of an iteration structure that exists within their language;

Program Logic

Mark B for correct conditions within an iteration structure to correctly loop

five times;

Mark C for using user input once in a logically appropriate place;

Mark D for correctly calculating the total from the inputted values;

Mark E for correctly outputting total in a logically appropriate place outside

the iteration structure;

I. Case

I. Messages or no messages with input and output statements

I. Gaps/spaces throughout the code, except where to do so would explicitly

alter the logic of the code in a way that makes it incorrect.

Maximum 4 marks if any errors in code.

Note to examiners

In C#/VB.NET examples, explicit variable declarations are not shown. Refer

to the specific language type issues section of the appropriate Marking

Guidance document. Any correct variable declarations in student answers

should be accepted.

C# Example 1 (fully correct)

The design mark is achieved (Mark A)

total = 0; Part of D

num = 0; Part of C

for (i = 0; i < 5; i++) { B

num = Convert.ToInt32(Console.ReadLine()); Part of C

total = total + num; Part of D

}

Console.WriteLine(total); E

A. Write in place of WriteLine;

I. missing Console.MARKSCHEME – COMPUTER SCIENCE – – JUNE 2025

VB.NET Example 2 (fully correct)

The design mark is achieved (Mark A)

num = 0 Part of C

counter = 0 Part of B

total = 0 Part of D 19

While counter < 5 Part of B

counter = counter + 1 Part of B

num = Console.ReadLine() Part of C

total = total + num Part of D

End While

Console.WriteLine(total) E

A. Write in place of WriteLine;

I. missing Console.

How to answer it

Python Data Types & Refactoring with Iteration

What this question tests

This question assesses foundational programming theory and core algorithm design: defining a data type, recognising the difference between arithmetic addition and string concatenation, selecting the Python float type, and converting repeated linear input statements into an efficient definite loop (iteration) using an accumulator pattern.

Question 05.1 • 1 Mark

Definition of a Data Type

Describe what is meant by a data type

✅ Acceptable Answers (Any 1)

  • Specifies the type of value/data that a variable can hold or store.
  • Defines the operations that can be validly performed on that value.

❌ Common Errors & Examiner Traps

  • The "Information" Trap: The mark scheme explicitly states R. Information in place of Data . Do not write "type of information a variable stores".
  • Giving examples instead: Listing int, string, bool gets 0 marks because the question asks to describe the concept, not name examples.
Mark Scheme Breakdown (AO1 Recall): 1 mark for identifying that it determines the kind of value stored in a variable or the operations permitted on it.
Question 05.2 • 1 Mark

Operations on Data: Numeric vs String

Explain why these variables do not have a string data type

✅ Acceptable Explanations (Any 1)

  • If they were strings, using + would concatenate (join) them together rather than add them numerically.
  • The values need to be added together mathematically (summed).
  • The arithmetic addition operator can only be applied to numeric data types.

🧠 Key Terminology

Examiners love the word concatenation:

  • Strings: "1" + "2" = "12" (concatenation)
  • Integers: 1 + 2 = 3 (mathematical addition)
Mark Scheme Breakdown (AO2 Application): 1 mark for clearly explaining concatenation or the necessity of mathematical addition for total calculation.
Question 05.3 • 1 Mark

Python Data Types for Fractions

State a data type in Python that should be used for numbers with a fractional part

✅ Correct Answer

float

Note: Case-insensitive in the exam (e.g. Float or float).

❌ Common Errors & Examiner Rejections

  • Writing Real : Marked wrong ( R. Real ). While "Real" is the general pseudocode term, the prompt explicitly demands: "in Python".
  • Writing Double or Decimal : While valid in C# or VB.NET, they are not standard built-in primitive Python keywords requested here.
Mark Scheme Breakdown (AO2 Application): 1 mark for float .
Question 05.4 • 5 Marks

Refactoring Linear Code into an Iteration Loop

Rewrite the program using an iteration structure that contains only one input() statement

✅ Model Answer (Python)

total = 0 for i in range (5): num = int ( input ()) total = total + num print ( total )

Alternative: total += int(input()) inside the loop is also fully credited.

📐 Step-by-Step Mark Breakdown (5 Marks)

  1. Mark A (Design): Uses an iteration structure valid in Python ( for or while ).
  2. Mark B (Logic): Correct loop condition to run exactly 5 times (e.g. range(5) or count < 5 ).
  3. Mark C (Logic): Exactly one user input converted to integer inside the loop.
  4. Mark D (Logic): Running total correctly accumulated ( total = total + num ).
  5. Mark E (Logic): Outputting total correctly outside the loop.

❌ Common Errors That Cost Marks

  • Indenting print(total) : Placing output inside the loop prints partial sums on every iteration. This loses Mark E.
  • Forgetting to initialise: If you omit total = 0 before the loop, Python throws an UnboundLocalError / NameError .
  • Off-by-one errors: Using range(1, 5) only loops 4 times, forfeiting Mark B. Use range(5) or range(0, 5) .
  • Any syntax error caps score: Mark scheme rule: Maximum 4 marks if any errors exist in code.

🧠 Exam Technique: Using the Grid Lines

The exam paper provides vertical grid lines. Python uses whitespace indentation to define code blocks. Ensure statements inside the loop start one column (indent) to the right, and print(total) aligns back to the left margin!

Topics

3.2 Programming · 3.2.1 Data types · 3.2.2 Programming concepts · 3.2.3 Arithmetic operations in a programming language · 3.2.7 Input/output

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.