Complete the code to start the motor only after the button is pressed.
IF button_pressed THEN motor_state := [1];The motor should turn ON when the button is pressed to start the process.
Complete the code to move to the next step only if the current step is done.
IF step_done THEN current_step := current_step [1] 1;
We add 1 to move to the next step after the current step is done.
Fix the error in the code to check if the sensor is active.
IF sensor_state = [1] THEN activate_alarm := TRUE;The sensor is active when its state is 1, so we check for 1.
Fill both blanks to create a sequence that turns on the heater after the valve opens.
IF valve_state = [1] THEN heater_state := [2];
The valve must be open (1) before turning the heater ON.
Fill all three blanks to create a dictionary that maps step names to their status if the status is active.
step_status = { [1]: [2] for [1], [2] in steps if [2] == [3] }We use 'step' as key, 'status' as value, and filter where status is 'active'.
