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.
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.