Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
Question 64

An algorithm is used to perform a diagnostic check on an autonomous deep-sea submersible before a dive. The pseudocode for this algorithm is shown below:

1  OUTPUT 'Run internal pressure test. Did it PASS?'
2  status ← USERINPUT
3  IF status = 'PASS' THEN
4      OUTPUT 'Run primary sonar diagnostic. Did it PASS?'
5      status ← USERINPUT
6      IF status = 'FAIL' THEN
7          OUTPUT 'Abort mission'
8      ELSE
9          OUTPUT 'Launch submersible'
10     ENDIF
11 ELSE
12     OUTPUT 'Is backup battery fully charged?'
13     status ← USERINPUT
14     IF status = 'FAIL' THEN
15         OUTPUT 'Abort mission'
16     ELSE
17         OUTPUT 'Connect auxiliary power and launch'
18     ENDIF
19 ENDIF

The phrase 'Abort mission' appears twice in this algorithm.

State the two possible sequences of user inputs (consisting of 'PASS' or 'FAIL') that would result in 'Abort mission' 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