AQA GCSE Computer Science Paper 1 (1C), June 2025: Question 2
7 marks · Medium difficulty · Programming
Complete a program using selection statements and write a program in VB.NET to calculate the total value of free food items based on user input.
Practise this questionQuestion
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 VB.NET 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
Dim i As Integer = 1
While i <= 20
If i Mod 20 = 0 Then
Console.WriteLine("Free cake")
ElseIf Then
Console.WriteLine ("Free pastry")
ElseIf i Mod 4 = 0 Then
Else
End If
i = i + 1
End While
02.1 State the VB.NET 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 VB.NET 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 VB.NET 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
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 (VB.NET)
This question assesses your ability to read, complete, and write functional procedural code in VB.NET (AO3 – design and write programs):
- Selection & Modulo arithmetic: using the modulo operator ( Mod ) to test for multiples and using If...ElseIf...Else constructs.
- Standard console I/O: prompting for and receiving inputs ( Console.ReadLine() ) and displaying outputs ( Console.WriteLine() ).
- Variables & Arithmetic expressions: declaring/using variables and computing a weighted sum using decimal values.
Completing Selection Statements using Modulo
Filling in missing VB.NET statements L1, L2, and L3
✅ Correct Answers
- L1: i Mod 5 = 0
- L2: Console.WriteLine("Free biscuit")
- L3: Console.WriteLine("Nothing free")
💡 Key Knowledge
- How Modulo works: i Mod n returns the remainder when i is divided by n . If i Mod n = 0 , i is an exact multiple of n .
- Order of conditions: A 20th stamp earns a cake, not a pastry or biscuit. Because 20 is a multiple of both 4 and 5, checking i Mod 20 = 0 must come first.
- Fall-through: The final Else catches all stamps where no reward is earned, requiring output: "Nothing free" .
🧠 Exam Technique
Read the specification carefully to identify exact required string outputs:
- Line above L1 already checks: If i Mod 20 = 0 (Free cake).
- Next branch outputs "Free pastry" (every 5th stamp) → L1 must check for multiples of 5.
- Branch ElseIf i Mod 4 = 0 needs the biscuit output in L2 → "Free biscuit" .
- The prompt requires exact strings: "Free biscuit" , "Free pastry" , "Free cake" , or "Nothing free" .
❌ Common Errors
- Using division ( / ) or Python syntax ( % ) instead of the VB.NET operator Mod .
- Writing an equality check with double equals ( == ). In VB.NET, comparison uses a single equals sign ( = ).
- Missing quotation marks around string literals inside Console.WriteLine(...) .
- Missing out the closing parentheses in method calls.
Writing a Complete Calculation & I/O Program
Reading user inputs, calculating total cost, and displaying results
✅ Model Solution (VB.NET)
• Mark A: User input stored in a variable for one item.
• Mark B: User inputs correctly stored in variables for all three items.
• Mark C: Correct mathematical expression calculating total value.
• Mark D: Outputting the computed total value.
📐 Calculation Breakdown
- Unit Prices:
• Biscuits = £1.00 each
• Pastries = £2.50 each
• Cakes = £3.00 each - Formula:
total = (biscuits * 1) + (pastries * 2.50) + (cakes * 3)
(Note: multiplying biscuits by 1 can simply be written as biscuits ). - Data Type Note: Because pastries cost 2.50, the total value can be a decimal, so store it in a Double or Decimal variable if explicitly declared.
🧠 Examiner Guidance & Tips
- Prompt messages: You are allowed to include prompt strings (e.g. Console.WriteLine("Enter biscuits: ") ) or omit them and read directly into variables. Both score full marks.
- Explicit declarations: In GCSE mark schemes, explicit type conversions (e.g., Convert.ToInt32(...) ) and explicit Dim statements are not strictly penalised if omitted, but writing clean declarations is best practice.
- Case-insensitivity: VB.NET is case-insensitive, so console.readline() is accepted.
❌ Common Errors to Avoid
- Hardcoding inputs: Assigning fixed numbers rather than reading input from the user (e.g., writing biscuits = 5 instead of reading from console). This loses Marks A and B!
- Mixing up multipliers: Pairing £2.50 with biscuits or cakes instead of pastries.
- Missing the output step: Calculating totalValue correctly but forgetting to print it with Console.WriteLine() (loses Mark D).
- Repeated syntax errors: A repeated identical syntax mistake (e.g. missing closing bracket on every readline) incurs a DPT (Definite Penalty Treatment), capping marks at 3/4.
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 (1C), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.