Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
Question 6

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?

A

Line 3

B

Line 6

C

Line 8

D

Line 11

Markscheme

Representing algorithms Questions

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

208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank