Question 2

AQA Computer Science June 2025 Paper 1A (8525/1A)GCSE7 marks

On the specification

2.1
3.2 Programming
2.2
3.2 Programming
Question text

2 A coffee shop has a loyalty scheme which rewards customers for buying drinks. box 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; } 2.1 State the C# code that should be written in place of the labels in the program written in Figure 2. [3 marks] 2.2 The coffee shop wants to work out the total value of the free biscuits, pastries and box 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 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]