An algorithm is shown in the pseudocode below:
1 moisture ← USERINPUT
2 IF NOT(moisture <= 12.5) AND moisture <= 40.0 THEN
3 irrigation ← "Moderate"
4 ELSEIF moisture > 40.0 AND moisture <= 80.0 THEN
5 irrigation ← "High"
6 ELSEIF moisture MOD 5 = 0 THEN
7 irrigation ← "Scheduled"
8 ELSE
9 irrigation ← "Off"
10 ENDIF
Rewrite line 2 from this algorithm without using the NOT operator.
The algorithm must still function in exactly the same way.
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.