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

7 marks · Medium difficulty · Programming

Complete missing lines in a Python program simulating a loyalty card scheme, and write a Python program to calculate the total monetary value of free items given out.

Practise this question

Question

Question 02 presents a loyalty card system where every 4th stamp gives a free biscuit, every 5th gives a free pastry, and 20 stamps gives a free cake. Question 02.1 shows a Python while loop with missing parts labelled L1, L2, and L3, asking students to state the code for each label. Question 02.2 gives prices for each free item (biscuit £1, pastry £2.50, cake £3) and asks students to write a program that inputs the quantity of each, calculates the total value, and outputs the result, providing an indentation grid.
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 Python program shown in Figure 2 should display whether the customer gets a

free biscuit, pastry, cake or nothing free for 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

i = 1

while i <= 20:

if i % 20 == 0:

print("Free cake")

elif :

print("Free pastry")

elif i % 4 == 0:

else:

i = i + 1

02.1 State the Python 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

• Each free pastry is worth £2.50

• Each free cake is worth £3

Write a Python 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

*04*•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 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.

[4 marks]

Mark scheme

Show the mark scheme Mark scheme for Question 02. Part 1 allocates 3 marks for AO3: L1 is 'i % 5 == 0:', L2 is 'print("Free biscuit")' and L3 is 'print("Nothing free")' (with C# and VB.NET equivalents shown). Part 2 allocates 4 marks for AO3: Mark A for user input into a variable for one item, Mark B for inputting and storing all three variables, Mark C for calculating the total value correctly, and Mark D for outputting the total value, with sample Python, C#, and VB.NET code provided.

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

Coffee Shop Loyalty Scheme & Daily Value Calculator

WHAT THIS QUESTION TESTS

This question assesses your ability to read, complete, and write functional Python code involving arithmetic operators (specifically modulo % for divisibility), selection constructs ( if / elif / else logic), input handling and data type casting ( int(input()) ), and basic arithmetic calculations with screen output.

PART 02.1 • 3 MARKS

Completing the Loyalty Scheme Selection Logic

Understanding Modulo and If-Elif-Else Execution

✅ Correct Code Solutions

  • L1: i % 5 == 0:
  • L2: print("Free biscuit")
  • L3: print("Nothing free")

Note: Examiner allows omission of the trailing colon on L1, as long as the condition i % 5 == 0 is correct.

💡 Key Knowledge: The Modulo Operator (%)

The modulo operator ( % ) calculates the remainder after integer division.

  • i % 5 == 0 checks if a number is an exact multiple of 5 (e.g. 5, 10, 15, 20).
  • Order matters: 20 is a multiple of both 4 and 5. The program checks i % 20 == 0 first so customers get cake instead of biscuits or pastries at 20 stamps!

🧠 Exam Technique

  • Match exact prompt text: The question specified the strings: "Free biscuit" and "Nothing free" . While minor typos aren't penalised harshly, matching them identically prevents losing marks.
  • Check Python syntax: Remember the double equals sign ( == ) for comparison. A single = is for assignment and causes a syntax error.

❌ Common Errors & Traps

  • Missing print parentheses: Writing print "Free biscuit" (Python 2 syntax) incurs a Deduct Per Topic (DPT) penalty for missing parentheses.
  • Writing output text only: Writing just "Free biscuit" without the print(...) function loses the mark for L2 and L3.
  • Using division instead of modulo: Using i / 5 == 0 instead of i % 5 == 0 .
Mark Breakdown (3 Marks total):
• 1 mark for correct condition at L1 ( i % 5 == 0 )
• 1 mark for correct output call at L2 ( print("Free biscuit") )
• 1 mark for correct default output call at L3 ( print("Nothing free") )
PART 02.2 • 4 MARKS

Calculating Daily Value of Free Items

Writing a Python Program with Input, Calculations, and Output

✅ Model Python Program

biscuits = int(input()) pastries = int(input()) cakes = int(input()) total_value = (biscuits * 1) + (pastries * 2.5) + (cakes * 3) print(total_value)

📐 Calculation Logic

Break down the prices and quantities clearly:

ItemQuantity VariableCost Each
Free Biscuits biscuits £1.00
Free Pastries pastries £2.50
Free Cakes cakes £3.00

Formula: Total = (biscuits * 1) + (pastries * 2.50) + (cakes * 3)

💡 Why Type Casting is Vital

By default, Python's input() function returns a string (text).

  • If you write biscuits = input() and enter 4 , Python stores "4" .
  • Multiplying a string by an integer (e.g. "4" * 3 ) produces "444" , not 12 !
  • Wrap inputs in int() or float() to convert them to numbers before doing arithmetic.

🧠 Exam Technique & Writing on Lined Grids

  • Prompts are optional: Writing input("Enter biscuits: ") is fine, but in AQA mark schemes, messages inside input() are completely optional unless explicitly specified. Simply input() scores full marks.
  • Meaningful variable names: Use clear identifiers like num_biscuits , pastries , total .
  • No indentation needed here: This program has a purely sequential flow (no loops or if-statements). Keep all statements flush with the left margin.

❌ Common Errors That Cap Marks

  • Forgetting to convert to integer: Not casting inputs means you can lose Mark B because the inputs cannot be used properly in calculations.
  • Missing the print statement: Calculating the value but failing to output it to the screen forfeits Mark D.
  • Wrong arithmetic symbols: Using x instead of * for multiplication.
  • Examiner rule: Maximum 3 marks if there are any syntax or logic errors present anywhere in the code.
Mark Breakdown (4 Marks total - AO3):
• Mark A: User input obtained and stored in a variable for at least one item.
• Mark B: Correct user input and storage in three separate variables for all three items (with numeric conversion).
• Mark C: Correct mathematical expression calculating the total value ( biscuits * 1 + pastries * 2.5 + cakes * 3 ).
• Mark D: Outputting the calculated total value to the screen using print() .

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