Question 2
AQA Computer Science June 2022 Paper 1 (7516/1)AS11 marks
On the specification
- 3.4 Theory of computation4.3 Fundamentals of algorithms
Question text
28 12 18 25 29 36 42 49 51 57 61 68 71 79 83 84 91 97 Table 2 S X Y P Z List[Z] 38 0 18 -1 Result: Copy the contents of all the unshaded cells in Table 2 into your Electronic Answer Document. [5 marks] 2 A parking meter has an Add hours button (+), an Accept button, a coin slot, a payment card reader, a Cancel button and a number keypad. The system operates in a specific sequence: • the system is initially in Idle Mode • when the user presses the + button the system goes into Select Hours Mode with the parking time set to 1 hour and the payment owed set to £1.00 o each time the user presses the + button again, the number of hours’ parking time increases by 1 and the payment owed increases by £0.50 o when the user presses the Accept button the system goes into Payment Due Mode and the user is able to make payments using cash or a payment card o the user can cancel the operation by pressing the Cancel button • using cash: o each time the user inserts a coin (except the final coin), the value of it is deducted from the payment owed o when the final coin that completes the payment is inserted, the system goes into Paid Mode • using a payment card: o when the user inserts a payment card into the card reader, the meter goes into a mode that allows the user to enter their PIN o the user then enters their PIN on the keypad o if the PIN is correct, the system goes into Paid Mode; otherwise the system goes into Idle Mode • the system remains in Paid Mode until the time paid for has elapsed. Figure 2 shows a partially completed state transition diagram that represents the operation of the parking meter. Four of the states are labelled (W) to (Z) and events are labelled (A) to (I). Figure 2 Complete Table 3 by filling in the unshaded cells with the correct labels from Figure 2. You should write: • which labels (A) to (I) represent which event(s) • which labels (W) to (Z) represent which state. Some of the cells in the table may need to be assigned more than one label. Each label must only be used once. Table 3 Event / State Label(s): (A) to (I), (W) to (Z) Card Payment Mode Enter correct PIN Enter incorrect PIN Insert a coin (except final coin) Insert final coin Insert payment card Paid Mode Payment Due Mode Press Accept Press Cancel Press + button Select Hours Mode Copy the contents of all the unshaded cells in Table 3 into your Electronic Answer Document. [6 marks]