Question 6

OCR Computer Science June 2019 Paper 2GCSE11 marks

On the specification

(a)(i)
2.1 Algorithms2.2 Programming techniques
(a)(ii)
2.2 Programming techniques
(b)(i)
2.6 Data representation
(c)(i)
2.1 Algorithms
(c)(ii)
2.1 Algorithms
(d)(i)
2.1 Algorithms2.2 Programming techniques
(d)(ii)
2.1 Algorithms
(d)(iii)
2.3 Producing robust programs
(d)(iv)
2.1 Algorithms
(e)
2.1 Algorithms2.2 Programming techniques
Question text

6 OCR Land is a theme park aimed at children and adults. Entrance tickets are sold online. An adult ticket to OCR Land costs £19.99, with a child ticket costing £8.99. A booking fee of £2.50 is added to all orders. (a) A function, ticketprice(), takes the number of adult tickets and the number of child tickets as parameters. It calculates and returns the total price to be paid. (i) Use pseudocode to create an algorithm for the function ticketprice(). [6] (ii) Tick (✓) one box to identify the data type of the value returned from the function ticketprice(), justifying your choice. Data type of returned value Tick (✓) one box Integer Real Boolean String Justification [2] (b) OCR Land regularly emails discount codes to customers. Each discount code includes a check digit as the last character. (i) Give one benefit of using a check digit for the discount code. [1] (c) A list of valid discount codes is shown below. [NIC12B, LOR11S, STU12M, VIC08E, KEI99M, WES56O, DAN34S] (i) State one reason why a binary search would not be able to be used with this data. [1] (ii) Give the name of one searching algorithm that would be able to be used with this data. [1]