6Easy
0/1

An automated hydroponic greenhouse dosing system uses the following algorithm to adjust nutrient concentration levels based on the growth stage entered by the operator:

1      stage ← USERINPUT
2      IF stage = 'seedling' THEN
3          dosage_ml ← 5
4      ELSE IF stage = 'vegetative' THEN
5          dosage_ml ← 25
6      ELSE IF stage = 'flowering' THEN
7          supplement ← 'potassium'
8      ELSE
9          OUTPUT 'invalid growth stage'
10     ENDIF
11     FOR pulse ← 1 TO dosage_ml
12         IF pulse < 15 THEN
13             INJECT_PUMP('A')
14         ELSE
15             INJECT_PUMP('B')
16         ENDIF
17     ENDFOR

State the number of possible values that the result of the boolean expression stage = 'vegetative' can take.

[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