Skip to content

Course home

Algorithms

Algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
Question 2

An automated double-door airlock system controls an inner door and an outer door. For safety reasons, both doors must never be open at the same time.

The system is controlled by the following algorithm:

1  WHILE (systemActive = True) DO
2
3      RECEIVE innerRequest FROM SENSOR_INNER
4      IF (innerRequest = True) THEN
5          SET innerDoor TO "Open"
6      END IF
7
8      RECEIVE outerRequest FROM SENSOR_OUTER
9      IF (outerRequest = True) THEN
10         SET outerDoor TO "Open"
11     END IF
12
13     IF (innerRequest = False) THEN
14         SET innerDoor TO "Closed"
15     END IF
16
17     IF (outerRequest = False) THEN
18         SET outerDoor TO "Closed"
19     END IF
20
21 END WHILE

State one condition allowed by the algorithm that does not meet the safety requirements for the airlock system.

[1]
Markscheme

Algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Algorithms

159 exam-style questions on Edexcel GCSE Computer Science Algorithms, covering Constructs for solving problems, Variables, constants and data structures, Arithmetic, relational and logical operators, Tracing algorithm output with trace tables, Types of error and correcting logic errors, Standard algorithms (sorts and searches), and Evaluating algorithm fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank