Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
Question 32

An algorithm is used to troubleshoot a smart home thermostat. The pseudocode for this algorithm is shown below:

1  OUTPUT 'Is the green LED flashing?'
2  response ← USERINPUT
3  IF response = 'yes' THEN
4      OUTPUT 'Is the router connected to the Internet?'
5      response ← USERINPUT
6      IF response = 'no' THEN
7          OUTPUT 'Replace device'
8      ELSE
9          OUTPUT 'Restart the router'
10     ENDIF
11 ELSE
12     OUTPUT 'Is the power cable damaged?'
13     response ← USERINPUT
14     IF response = 'yes' THEN
15         OUTPUT 'Replace device'
16     ELSE
17         OUTPUT 'Plug into a different socket'
18     ENDIF
19 ENDIF

The phrase 'Replace device' appears twice in this algorithm.

State the two possible sequences of user inputs (consisting of 'yes' or 'no') that would result in 'Replace device' being output.

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