An automated water treatment plant uses an algorithm to regulate pump flow rates based on turbidity levels and reservoir height.
1 # Water treatment plant pump controller
2
3 WHILE (systemActive == TRUE) DO
4 IF (turbidityLevel > 12.5) THEN
5 SEND ("Activate secondary filtration") TO VALVES
6 ELSE
7 IF (reservoirHeight < 1.5) THEN
8 SEND ("High flow rate") TO PUMPS
9 ELSE
10 SEND ("Standard flow rate") TO PUMPS
11 END IF
12 END IF
13 READ sensorInputs
14 END WHILE
State the name of the programming construct used in line 3 of the algorithm.
50 exam-style questions on Edexcel GCSE Computer Science Constructs, covering Structural components of programs and Writing programs with control constructs. Each one has a worked solution and a mark scheme showing where the marks go.