2
0/1

An automated brewing vessel uses the following algorithm to adjust temperature and valve settings based on the system status entered by an operator:

Figure 1

1      status ← USERINPUT
2      IF status = 'boil' THEN
3          target_temp ← 100
4      ELSE IF status = 'mash' THEN
5          target_temp ← 65
6      ELSE IF status = 'ferment' THEN
7          glycol_valve ← 'open'
8      ELSE
9          OUTPUT 'status invalid'
10     ENDIF
11     FOR step ← 1 TO target_temp
12         IF step < 70 THEN
13             ENGAGE_HEATER('low_power')
14         ELSE
15             ENGAGE_HEATER('high_power')
16         ENDIF
17     ENDFOR

State how many possible values the result of the comparison status = 'ferment' can have.

[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