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.
📋 Examiner Report & Trap Analysis
Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...
🎯 Mark Scheme Breakdown
Award 1 mark for identifying the correct principle. Award 1 mark for showing clear working. Common errors include failing to convert units and misreading the scale. The examiner report notes that only 34% of candidates achieved full marks on this question.
Unlock the Examiner's Analysis
Sign up for free to reveal the full examiner report, trap analysis, and mark scheme breakdown for this question.
Sign Up Free to Unlock →Join thousands of Cambridge students already using Oracle Prep