Question 2
AQA Computer Science June 2022 Paper 1A (8525/1A)GCSE6 marks
On the specification
- 2.1
- 3.1 Fundamentals of algorithms3.2 Programming
- 2.2
- 3.2 Programming
- 2.3
- 3.2 Programming
- 2.4
- 3.2 Programming
Question text
2 Figure 3 shows an algorithm, represented using pseudo-code, that calculates the box delivery cost for an order from a takeaway company. Figure 3 orderTotal USERINPUT deliveryDistance USERINPUT deliveryCost 0.0 messageOne "Minimum spend not met" messageTwo "Delivery not possible" IF deliveryDistance ≤ 5 AND orderTotal > 0.0 THEN IF orderTotal > 50.0 THEN deliveryCost 1.5 OUTPUT deliveryCost ELSE IF orderTotal > 25.0 THEN deliveryCost (orderTotal / 10) * 2 OUTPUT deliveryCost ELSE OUTPUT messageOne ENDIF ELSE OUTPUT messageTwo ENDIF 2.1 Using Figure 3, complete the table. [2 marks] Input value of Input value of Output orderTotal deliveryDistance 55.5 2 35.0 5 2.2 State how many possible values the result of the comparison deliveryDistance ≤ 5 could have in the algorithm shown in Figure 3. [1 mark] 2.3 box State the most suitable data type for the following variables used in Figure 3. [2 marks] Variable identifier Data type deliveryCost messageOne 2.4 State one other common data type that you have not given in your answer to Question 02.3. [1 mark]