Question 1 Report
The railway maintenance program decides whether a track section can be reopened after overnight work. The section is available if an engineer has signed it off and either the automated sensor test passes or a manual inspection passes. The program stores the three results as Boolean variables. A supervisor wants to use the statement open = signedOff AND (sensorPass OR manualPass). This prevents an unsigned section opening merely because a test result is positive. Consider a section that is signed off, fails the sensor test, but passes manual inspection.
(a) Explain why the OR operation is inside brackets. [2]
(b) When the three values are True, False and True in the order given, state the value of open. [1]
(c) When signedOff is False and both test variables are True, state the value of open. [1]
(d) Explain why the sign-off check is important in this program. [1]
The rule is open = signedOff AND (sensorPass OR manualPass).
sensorPass OR manualPass is grouped together. [1] The resulting test decision is then combined with signedOff using AND. [1]signedOff is False, then even if both tests pass, False AND True is False. [1]Everything you need to excel in your exams