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

8 marks · Medium difficulty · Programming

Explain data types and rewrite a VB.NET program calculating the sum of five inputs using an iteration structure.

Practise this question

Question

The question presents a VB.NET program in Figure 5 that reads five integer inputs into variables num1 to num5, adds them together into variable total, and outputs total using Console.WriteLine. Part 05.1 asks for a description of what is meant by a data type (1 mark). Part 05.2 asks to explain why num1 through num5 do not have a string data type (1 mark). Part 05.3 asks for a VB.NET data type for numbers with a fractional part (1 mark). Part 05.4 asks to rewrite the program in VB.NET using an iteration structure containing only one Console.ReadLine() statement, providing an indentation grid for the answer (5 marks).
Question text

05 The VB.NET program in Figure 5 gets five numbers and outputs the sum of those

numbers.

Figure 5

Dim num1 As Integer = Console.ReadLine()

Dim num2 As Integer = Console.ReadLine()

Dim num3 As Integer = Console.ReadLine()

Dim num4 As Integer = Console.ReadLine()

Dim num5 As Integer = Console.ReadLine()

Dim total As Integer = num1 + num2 + num3 + num4 + num5

Console.WriteLine(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 VB.NET 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 Console.ReadLine()statement.

Your answer must be written in VB.NET.

You should use meaningful variable name(s) and VB.NET 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 05. Part 05.1 awards 1 mark for specifying the type of value/data a variable stores or defining allowable operations on a value. Part 05.2 awards 1 mark for explaining that strings would concatenate or arithmetic addition requires numeric types. Part 05.3 awards 1 mark for Double, Single, or Decimal. Part 05.4 awards up to 5 marks: 1 design mark for an iteration structure, and 4 logic marks for looping correctly five times, taking user input once inside the loop, calculating the running total, and correctly 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

AQA GCSE Computer Science: Data Types & Iteration

📋 What this question tests

This question assesses your understanding of fundamental data types and practical program design with iteration (loops). Specifically: defining what a data type is, understanding why numeric types are essential for arithmetic, identifying language-specific types for fractional/real numbers in VB.NET, and rewriting inefficient repeated code using a running total inside a loop.

Question 05.1 • 1 Mark

Definition of a Data Type

AO1 (Recall)

✅ Acceptable Answers (Any one)

  • Specifies the type of value/data a variable stores or holds.
  • Defines the operations that can be performed on the data stored in a variable.

❌ Common Errors & Traps

  • Writing "information" instead of "data" or "value" (The mark scheme explicitly rejects "information").
  • Simply listing data types (e.g. "Integer, String, Boolean") without defining what the term means.
Mark Scheme Note: Award 1 mark for specifying the category/type of value stored, or the operations permitted on it.
Question 05.2 • 1 Mark

Why Use Integer Instead of String?

AO2 (Application)

✅ Correct Explanation (Any one)

  • If they were strings, using the + operator would concatenate (join) the characters together instead of adding them numerically.
  • The values must be added together / summed mathematically.
  • Arithmetic operators (addition) can only be performed on numeric values.

💡 Key Knowledge

With integers: 5 + 5 = 10 .
With strings: "5" + "5" = "55" (concatenation). Since the program goal is calculating a sum, string variables would break the logic.

Examiner Insight: Top answers clearly mention the word concatenate or state that arithmetic addition cannot be performed on string data.
Question 05.3 • 1 Mark

Data Type for Fractional Numbers in VB.NET

AO2 (Application)

✅ Correct Answer

Any of the following valid VB.NET types:

  • Double
  • Single
  • Decimal

❌ What Is Rejected

  • Reject: Real — Although "Real" is an accepted pseudocode term, the question specifically asks for a "data type in VB.NET", where Real is not a keyword.
  • Reject: Float — In VB.NET, single-precision floating point is named Single .
Question 05.4 • 5 Marks

Refactoring with Iteration (VB.NET)

AO3 (1 mark Design, 4 marks Programming)

📐 Model Solution: Using a For Loop (Recommended)

Dim total As Integer = 0 For i As Integer = 1 To 5 Dim num As Integer = Console.ReadLine() total = total + num Next Console.WriteLine(total)

📐 Alternative Solution: Using a While Loop

Dim total As Integer = 0 Dim counter As Integer = 0 While counter < 5 Dim num As Integer = Console.ReadLine() total = total + num counter = counter + 1 End While Console.WriteLine(total)

🧠 Mark Breakdown (5 Marks Total)

  • Mark A (Design): Using an iteration construct ( For or While ) available in VB.NET.
  • Mark B (Logic): Setting loop bounds so it executes exactly 5 times ( 1 To 5 or 0 To 4 ).
  • Mark C (Logic): Calling Console.ReadLine() once inside the loop.
  • Mark D (Logic): Correctly maintaining an accumulator/running total ( total = total + num ).
  • Mark E (Logic): Outputting the total ( Console.WriteLine(total) ) outside the loop.

❌ Critical Traps to Avoid

  • Placing WriteLine inside the loop: This prints the subtotal on every turn rather than just the final sum.
  • Resetting total inside the loop: Putting Dim total = 0 inside the loop resets it each time! It must be initialised before the loop starts.
  • Off-by-one errors: e.g., For i = 0 To 5 loops 6 times, not 5.
  • Max 4 marks: Any syntax error or logic slip caps your mark at 4/5.

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 (1C), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.