Question 4

OCR Computer Science June 2017 Paper 1AS11 marks

On the specification

(a)
2.2 Problem solving and programming
(b)
1.3 Exchanging data
(c)(i)
1.1 The characteristics of contemporary processors, input, output and storage devices
(c)(ii)
1.3 Exchanging data
Question text

4 A delivery company sends parcels across the UK. (a) The company charges on the following basis: 3 • Parcels that have a volume of less than 0.3 m and weigh less than 4 kg cost £5 to send. 3 • All other parcels cost £20 per m or £2 per kg, whichever is greater. Examples 3 Parcel A weighs 2.5 kg, has a volume of 0.1 m and costs £5 to send. 3 Parcel B weighs 6 kg, has a volume of 0.2 m and costs £12 to send. 3 Parcel C weighs 6 kg, has a volume of 0.8 m and costs £16 to send. The function getCost takes in the volume and weight of a parcel and returns the cost. getCost(2.5,0.1) returns 5 getCost(6,0.2) returns 12 getCost(6,0.8) returns 16 Complete the pseudo-code below so that the function getCost returns the correct cost. function getCost(weight, volume) endfunction [4] (b) Details of customers sending parcels are stored in a database. The database contains a table called parcel and a table called customer. Draw an entity relationship diagram showing the parcel and customer tables. [2] (c) To prove parcels have not been damaged in transit, the delivery drivers use a digital camera to take a photograph of them when they arrive at their destination. The digital camera uses flash memory. (i) Describe one advantage of the digital camera using flash storage rather than magnetic. [2] (ii) Explain whether lossless or lossy compression would be most appropriate to store the photographs. Justify your response. [3]