Skip to content

Course home

Boolean operations in a programming language

Boolean operations in a programming language

EasyMedium
123456789101112131415161718
Question 2

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