Question 18
AQA Computer Science June 2024 Paper 1 (7516/1)AS13 marks
On the specification
- 18.1
- 3.1 Fundamentals of programming3.2 Fundamentals of data structures3.3 Systematic approach to problem solving
- 18.2
- 3.3 Systematic approach to problem solving
Question text
18 This question extends the functionality of the Skeleton Program. Till 0 is not currently used. It is to be used as the express till that buyers with fewer than 10 items in their basket can use. If till 0 is idle, the next buyer in the queue with fewer than 10 items in their basket comes out of the queue and gets served at till 0. What you need to do: Task 1 Write a new subroutine ServeBuyerExpress that: • finds the first buyer in the queue who has fewer than ten items in their basket and if there is one: o removes the buyer’s details from the queue o closes the gap in the queue o displays the buyer’s ID o calls the UpdateStats subroutine for the express till o calls the CalculateServingTime subroutine for the express till. Task 2 Amend the subroutine Serving to check whether the express till is free and, if it is, call the subroutine ServeBuyerExpress before checking the availability of other tills. Task 3 Amend the subroutine OutputTillAndQueueStates to output the data for till 0 as well as the data about the other tills which it already outputs. Task 4 Test that the changes you have made work by conducting the following test: • run your amended Skeleton Program • enter N Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 18.1 Your PROGRAM SOURCE CODE for the entire subroutine ServeBuyerExpress, the entire subroutine Serving and the entire subroutine OutputTillAndQueueStates. [12 marks] 18.2 SCREEN CAPTURE(S) showing the requested test described in Task 4. The SCREEN CAPTURE(S) only need to show the entire output for time unit 8. [1 mark]