Question 1 of 5
A snack machine uses the segment below. Sensor values are temp = 4 and doorOpen = false. (a) State what is displayed and briefly justify with a trace of the outer and inner tests. (b) Change only doorOpen so that restock is displayed. Give that Boolean value. (c) Explain why the inner assignment to status is not reached when temp is 12 and doorOpen is true.
IF (temp < 5)
{
IF (doorOpen)
{
status ← "restock"
}
ELSE
{
status ← "chilling"
}
}
ELSE
{
status ← "too warm"
}
DISPLAY (status)