Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 8
Easy

An algorithm for monitoring a temperature sensor is shown below.

1  threshold ← 25.5
2  reading ← USERINPUT
3  IF reading > threshold THEN
4      OUTPUT "Warning: High Temp"
5  ELSE
6      WHILE reading <= threshold
7          reading ← USERINPUT
8          IF reading < 0 THEN
9              OUTPUT "Error: Sub-zero"
10         ENDIF
11     ENDWHILE
12     OUTPUT "Normalised"
13 ENDIF

On which line is indefinite iteration first used in this algorithm?

Line 3

Line 6

Line 8

Line 11

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms