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