Question 1
AQA Computer Science June 2017 Paper 1AS4 marks
On the specification
- 1.1
- 3.4 Theory of computation
Question text
1 A hotel provides a safety deposit box in guest rooms. The safety deposit box has a keypad with twelve buttons, as shown in Figure 1. Figure 1 12 3 45 6 78 9 C 0 E The safety deposit box operates as follows: The buttons with digits 0 to 9 enable the guest to set their own code. Button C cancels any digits entered. Button E is the Enter key. • To close the safety deposit box: o push the door shut o key in a new 4-digit code (guest’s choice) o press the Enter key (this sets the code and locks the door). • To open the safety deposit box: o key in the correct 4-digit code (previously chosen by the guest) o press the Enter key (this also deletes the stored code) o pull open the door. • Pressing the keypad has no effect, except when keying in a code. Figure 2 shows a partially complete state transition diagram that represents the operation of the safety deposit box. The events are labelled (a) to (h). Note the state transition diagram does not show what happens if an incorrect code is keyed in. Figure 2 1.1 In Table 1 indicate which label(s), (a) to (h), represent(s) which event. Two labels have to be assigned to some of the events. Complete Table 1 by filling in the unshaded cells with the correct labels from Figure 2. A label must only be used once. Table 1 Event Label(s): (a) to (h) Correct code keyed Door pulled open Door pushed shut New code keyed Press C Press E Copy the contents of all the unshaded cells in Table 1 into your Electronic Answer Document. [4 marks]