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.
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.