An automated climate control system uses a temperature sensor to manage a greenhouse environment.
Figure 1 shows the algorithm used by the system.
Figure 1
1 temp ← GET_TEMPERATURE()
2 IF NOT(temp <= 16.5) AND temp < 28.0 THEN
3 OUTPUT "Active"
4 ELSEIF temp <= 16.5 AND temp >= 5.0 THEN
5 OUTPUT "Dormant"
6 ELSE
7 OUTPUT "Alarm"
8 ENDIF
Rewrite line 2 from the algorithm in Figure 1 without using the NOT operator.
The algorithm must still have the same functionality.
19 exam-style questions on AQA GCSE Computer Science Boolean operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.