Skip to content
MathsGenie logo
Open app

Course home

  1. GCSE
  2. Computer Science AQA
  3. Question bank

Programming concepts

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839
Question 34

An algorithm is designed to manage an automated greenhouse irrigation system.

1      humidity ← USERINPUT
2      status ← 'normal'
3      IF humidity < 30 THEN
4          status ← 'dry'
5      ELSE IF humidity > 70 THEN
6          status ← 'wet'
7      ENDIF
8      WHILE status = 'dry'
9          IF humidity < 15 THEN
10             OPEN_VALVE(2)
11         ELSE
12             OPEN_VALVE(1)
13         ENDIF
14         humidity ← USERINPUT
15     ENDWHILE

Which line number shows where selection is first used in the algorithm?

Line number 2

Line number 3

Line number 8

Line number 9

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts