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.
✓ Correct Answer
The correct answer is —. This question tests the candidate's understanding of modular programming within the Computer Sciencesyllabus. The examiner's mark scheme requires...
📋 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...
Unlock the Examiner's Answer
Sign up for free to reveal the correct answer, the official mark scheme breakdown, and the examiner trap analysis for this question.
Sign Up Free to Unlock →Join thousands of Cambridge students already using Oracle Prep