Note AcademyNote Academy

Computer Science (AS & A Level) · May / June 2025 · Paper 21 · Question 7

9618

As printed in the paper

The question as text

A program is being developed to implement a customer loyalty scheme for a coffee shop. The programmer has decided that the following data items need to be stored for each customer: Data item Description customer ID a unique six-digit string points an integer value that is increased by one for every cup of coffee the customer orders When a customer visits the shop and orders coffee, the scheme operates as follows: • The total number of points is increased by the number of coffees ordered. • If just one cup of coffee is ordered and the number of points goes above 10, then: ◦ the cup of coffee they have just ordered is given to them free of charge ◦ the number of points is reduced by 11. • If the order is for multiple coffees and the number of points goes above 10, then: ◦ they get one coffee free of charge for every 11 points ◦ the number of points is reduced by 11 for each free coffee. For example, the: • customer currently has 9 points • customer orders 16 cups of coffee • total number of points now becomes 25 • customer gets 2 free coffees and now has 3 points left. The programmer has defined a program module that is called every time a customer places an order: Module Description CustomerOrder() • called with two integer parameters: ◦ the number of coffees ordered ◦ the current number of points • output a suitable message giving the number of free coffees • return a value for the new points total.

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 7(a)[6]

  • 7(b)(i)[8]

  • 7(b)(ii)[4]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.