Question 1 Report
In the recycling-centre program, a conveyor starts only when the emergency stop is not pressed and the safety gate is closed. The controller receives signals from two switches. The Boolean variable stopPressed is True when the emergency button is pressed. gateClosed is True when the gate is fully shut. A technician is writing test cases for the main program and needs to include conditions that would stop the conveyor. The program must fail safely if either protective requirement is not met.
(a) Explain why the required condition can be written as NOT stopPressed AND gateClosed. [2]
(b) When stopPressed is False and gateClosed is True, state whether the conveyor may start. [1]
(c) When stopPressed is True and gateClosed is True, state whether the conveyor may start. [1]
The city bike-hire app offers a free ride extension if a rider has reported a faulty docking station or if the system has recorded a payment error. A customer service subroutine sets faultReport and paymentError. The following statement is used: extendRide = faultReport OR paymentError. A rider has made a fault report but no payment error is recorded. Another rider has neither condition recorded. Customer service needs to explain the two different displayed outcomes without changing the database records.
(a) Explain why the first rider receives an extension. [2]
(b) When both Boolean variables are False, state the value of extendRide. [1]
(c) Explain why changing OR to AND would reduce the number of riders who receive an extension. [1]
Recycling-centre conveyor condition
NOT stopPressed requires the emergency stop button not to be pressed. [1] AND gateClosed requires the gate to be closed too, because both protective conditions are required before the conveyor starts. [1]stopPressed is False, then NOT stopPressed is True. True AND True means the conveyor may start. [1]stopPressed is True, then NOT stopPressed is False. False AND True is False, so the conveyor may not start. [1]Bike-hire extension condition
faultReport=True. [1] Because OR is True when one input is True, extendRide is True and the rider receives an extension. [1]extendRide is False. [1]AND would require both a fault report and a payment error. [1] Fewer riders would meet both conditions, so fewer would receive an extension.Everything you need to excel in your exams