The airport has touchless handwashing stations - Edexcel - GCSE Computer Science - Question 3 - 2020 - Paper 1
Question 3
The airport has touchless handwashing stations. The stations automatically dispense soap, water and warm air for drying. To conserve water, the stations must ensure ... show full transcript
Worked Solution & Example Answer:The airport has touchless handwashing stations - Edexcel - GCSE Computer Science - Question 3 - 2020 - Paper 1
Step 1
3a: Identify the sensor used for water dispensing
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
SENSOR_W
Step 2
3b: Explain the issue in the algorithm regarding operations
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The algorithm would allow for two operations to be carried out at the same time, contradicting the requirement that only one operation should occur at any given moment.
Step 3
3c: Correcting the soap dispensing condition in the algorithm
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To ensure exclusive operation, the condition should be adjusted as follows:
IF (soapRequest = True) THEN
SET soapStatus TO "on"
ELSE
SET soapStatus TO "off"
END IF
Step 4
3d: Provide the correct logical structure for exclusive operation
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The proper structure to ensure mutual exclusivity for the operations is:
NOT (soapRequest AND waterRequest AND dryerRequest)
OR
(NOT soapRequest AND NOT waterRequest AND NOT dryerRequest)