Skip to content

Course home

Boolean operations in a programming language

Boolean operations in a programming language

EasyMedium
123456789101112131415161718
Question 15

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.

[1]
Markscheme

Boolean operations in a programming language Questions

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

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.

Question bank