AQA GCSE Computer Science Paper 1 (1A), June 2025: Question 2

7 marks · Medium difficulty · Programming

Complete missing lines of a C# program checking divisibility for a loyalty scheme, and write a program to calculate the total value of free items given out.

Practise this question

Question

Question 02 is divided into two parts. Part 02.1 presents a scenario where a customer earns stamps for drinks: every 4th stamp gives a free biscuit, every 5th a free pastry, and on the 20th stamp a free cake (no biscuit or pastry). A C# while loop is provided with three blank labels (L1, L2, L3) to be filled in. Part 02.2 asks students to write a C# program to input the counts of free biscuits (£1), pastries (£2.50), and cakes (£3), calculate the total value, and output it, with an indentation grid provided.
Question text

02 A coffee shop has a loyalty scheme which rewards customers for buying drinks.

The customer gets one stamp on their loyalty card for each individual drink they buy.

• Every 4th stamp on the card gets the customer a free biscuit.

• Every 5th stamp on the card gets the customer a free pastry.

• When the customer reaches 20 stamps, they get a free cake (but no biscuit or

pastry).

The C# program shown in Figure 2 should display whether the customer gets a free

biscuit, pastry, cake or nothing free for each of their first 20 drinks.

For each drink purchased, the program must output either: "Free biscuit",

"Free pastry", "Free cake" or "Nothing free".

Some parts of the program have been replaced with the labels to .

Figure 2

int i = 1;

while (i <= 20) {

if (i % 20 == 0) {

Console.WriteLine("Free cake");

}

else if ( ) {

Console.WriteLine("Free pastry");

}

else if (i % 4 == 0) {

;

}

else {

;

}

i = i + 1;

}

02.1 State the C# code that should be written in place of the labels in the program

written in Figure 2.

[3 marks]

02.2 The coffee shop wants to work out the total value of the free biscuits, pastries and

cakes given out each day.

• Each free biscuit is worth £1

*04*•Each free pastry is worth £2.50

• Each free cake is worth £3

Write a C# program to get the number of free biscuits, pastries and cakes, and

calculate the total value for the day.

Your program must:

• get the user to enter the number of free biscuits and store it in a variable

• get the user to enter the number of free pastries and store it in a variable

• get the user to enter the number of free cakes and store it in a variable

• calculate the total value of the free items

• output the total value of the free items.

You should use meaningful variable name(s) and C# syntax in your answer.

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

[4 marks]

Mark scheme

Show the mark scheme Mark scheme for Question 02. Part 1 allocates 3 marks for replacing labels L1 with 'i % 5 == 0', L2 with 'Console.WriteLine("Free biscuit");', and L3 with 'Console.WriteLine("Nothing free");' (equivalent Python and VB.NET syntax also shown). Part 2 allocates 4 marks: Mark A for input and storing one item, Mark B for input and storing all three, Mark C for calculating the total value correctly, and Mark D for outputting the total, including example solutions in C# and Python.

Total

Question Part Marking guidance

marks

02 1 3 marks for AO3 (program) 3

C#

i % 5 == 0;

Console.WriteLine("Free biscuit");

Console.WriteLine("Nothing free");

A. Write in place of WriteLine;

I. missing Console.

Python

i % 5 == 0;

print("Free biscuit");

print("Nothing free");

VB.NET

i Mod 5 = 0;

Console.WriteLine("Free biscuit");

Console.WriteLine("Nothing free");

A. Write in place of WriteLine;

I. missing Console.

I. Case

I. Minor spelling mistakes in output messages

DPT. Missing parenthesesMARK SCHEME – – –

Total

Question Part Marking guidance

marks

02 2 4 marks for AO3 (program) 4

Program Logic

Mark A for using user input and storing the result in a variable for one of the

number of biscuits, pastries or cakes;

Mark B for using user input and storing the results in three variables

correctly for the number of biscuits, pastries and cakes;

Mark C for expressions that calculate the total value correctly;

Mark D for outputting the total value; 7

DPT. Repeated identical syntax errors in the three input commands

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 3 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)

totalValue = 0;

biscuits = Convert.ToInt32(Console.ReadLine()); A, Part of B

pastries = Convert.ToInt32(Console.ReadLine()); Part of B

cakes = Convert.ToInt32(Console.ReadLine()); Part of B

totalValue = biscuits * 1 + pastries * 2.5 + C

cakes * 3;

Console.WriteLine(totalValue); D

A. Write in place of WriteLine

I. missing Console.

Python Example 1 (fully correct)

biscuits = int(input()) A, Part of B

pastries = int(input()) Part of B

cakes = int(input()) Part of B

totalValue = biscuits * 1 + pastries * 2.5 + C

cakes * 3

print(totalValue) D

How to answer it

Loyalty Scheme & Item Value Calculator (C# Programming)

📌 What this question tests

This question assesses core algorithmic thinking and C# implementation skills under AO3 (Design & Develop Programs):

  • Selection & Modulo Operator: Using the modulo operator ( % ) to test for multiples and managing selection hierarchy ( if / else if / else ).
  • User Input & Type Conversion: Reading string input using Console.ReadLine() and converting it to numeric types ( Convert.ToInt32() or int.Parse() ).
  • Variables & Arithmetic Expressions: Storing data in meaningful variables and calculating totals using multiplication and addition.
  • Console Output: Displaying calculated results clearly using Console.WriteLine() .
Question 02.1 • 3 Marks

Completing the Selection Algorithm

Filling in missing labels L1, L2, and L3

✅ Correct Answers (1 mark each)

  • L1: i % 5 == 0
  • L2: Console.WriteLine("Free pastry"); or Console.Write("Free pastry");
    Wait! Ensure you read the question labels carefully:
    • In the code, pastry is already printed for L1. Label L2 is inside else if (i % 4 == 0) , so:
    L2: Console.WriteLine("Free biscuit");
  • L3: Console.WriteLine("Nothing free");

💡 Key Knowledge: The Modulo Operator (%)

The modulo operator gives the remainder after integer division:

  • i % 5 == 0 evaluates to true whenever i is a multiple of 5 (e.g. 5, 10, 15, 20).
  • Order matters in selection: Notice that the code checks i % 20 == 0 first. Because 20 is divisible by both 4 and 5, checking it first prevents customers getting a biscuit or pastry instead of their free cake!

🧠 Exam Technique & Mark Scheme Notes

  • Console is optional: Examiners allow omitting Console. (e.g. just writing WriteLine("Free biscuit"); ), but writing full syntax guarantees you avoid ambiguity.
  • Case insensitivity: The mark scheme ignores letter casing errors for methods, but getting into the habit of typing exact PascalCase ( WriteLine ) is best practice.
  • No missing parentheses: Don't drop parentheses around condition expressions or method parameters.

❌ Common Errors to Avoid

  • Assignment vs Comparison: Writing i % 5 = 0 instead of == 0 . A single equals sign assigns; double equals tests equality.
  • Division instead of Modulo: Writing i / 5 == 0 . 5 / 5 gives 1, not 0!
  • Swapping L2 and L3: Always check which condition matches which branch: condition i % 4 == 0 corresponds to the free biscuit!
Mark Breakdown (3 Marks):
• 1 mark for correct condition in L1 ( i % 5 == 0 )
• 1 mark for correct output in L2 ( Console.WriteLine("Free biscuit"); )
• 1 mark for correct default output in L3 ( Console.WriteLine("Nothing free"); )
Question 02.2 • 4 Marks

Writing a Calculation Program in C#

Calculating daily revenue value for free items given out

✅ Model Answer (Full 4 Marks)

int biscuits = Convert.ToInt32(Console.ReadLine()); int pastries = Convert.ToInt32(Console.ReadLine()); int cakes = Convert.ToInt32(Console.ReadLine()); double totalValue = (biscuits * 1) + (pastries * 2.50) + (cakes * 3); Console.WriteLine(totalValue);

📐 Step-by-Step Logic Breakdown

  1. Step 1: Get Inputs
    Prompt or directly read three user inputs from the console. Convert each string to an integer using Convert.ToInt32() or int.Parse() .
  2. Step 2: Apply Unit Values
    • Biscuits: £1 each ( biscuits * 1 )
    • Pastries: £2.50 each ( pastries * 2.5 )
    • Cakes: £3 each ( cakes * 3 )
  3. Step 3: Sum the Subtotals
    Add all three together to compute the overall total value.
  4. Step 4: Output the Result
    Print the total using Console.WriteLine(totalValue); .

💡 Data Types Matter

  • String to Number: Console.ReadLine() returns text ( string ). You cannot do arithmetic directly with strings.
  • Floating-point calculations: Pastries cost £2.50 (a decimal), so the total must be stored in a type capable of holding decimals (e.g. double or float ).
  • Note: In AQA GCSE mark schemes, explicit type declarations at the start of variables are leniently assessed, but proper syntax avoids losing marks.

🧠 Mark Scheme Breakdown

  • Mark A: Taking user input and storing it in a variable for at least one item.
  • Mark B: Taking input and storing into three distinct variables for biscuits, pastries, and cakes.
  • Mark C: Correct mathematical expression to calculate the total value.
  • Mark D: Outputting the calculated total.
  • Crucial Examiner Rule: Maximum 3 marks if there are any syntax errors anywhere in the code. To get 4/4, your code must be completely error-free!

❌ Common Traps

  • Forgetting Conversion: Writing biscuits = Console.ReadLine(); without parsing causes a type mismatch error.
  • Wrong Math Multipliers: Mixing up the prices (e.g. multiplying cakes by 2.5 and pastries by 3).
  • Missing Semicolons: In C#, every instruction statement must end with a semicolon ( ; ). Missing even one can cap you at 3 marks!

Topics

3.2 Programming · 3.2.2 Programming concepts · 3.2.3 Arithmetic operations in a programming language · 3.2.4 Relational operations in a programming language · 3.2.7 Input/output

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.