13Easy
0/1

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.

[1]

Boolean operations in a programming language Questions

Practise AQA GCSE Computer Science Boolean operations in a programming language with exam-style questions for GCSE Computer Science. 19 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Boolean operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /Boolean operations in a programming language