Question 8
Edexcel Computer Science June 2019 Paper 2GCSE12 marks
On the specification
- (a)
- 1.2 Algorithms
- (b)
- 1.2 Algorithms6.6 Subprograms
Question text
8 Margaret is making some special offers to customers. (a) Customers can get a money off voucher for their favourite item. • Customers whose favourite item is ice cream get a money off voucher for ice cream. • Customers whose favourite item is cookies get a money off voucher for cookies. • Customers who do not choose either get a money off voucher for drinks. This shape represents input or output. Complete the flowchart to show this process. (6) Start Yes Choice = = Print ice ice cream? cream voucher No Print cookie voucher (b) Some customers can get a free cookie when they buy a hot drink. A program needs to tell Margaret which customers qualify for a free cookie. She gives a free cookie to the first 10 customers who buy a hot drink. A subprogram called waitForPurchase() pauses the program until the next customer makes a purchase. A call to this subprogram is denoted in the flowchart as waitForPurchase This shape represents input or output. Draw a flowchart to display a ‘Free cookie’ message so that the first 10 customers who buy a hot drink also get a free cookie. Please draw your flowchart on pages 25, 26 and 27. You may not need all of this space for your answer. Please draw a line through any work you do not want to be marked. (6)