Skip to content

Course home

Algorithms

Algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
Question 28

An algorithm designed to monitor the safety status of a chemical reactor based on its core temperature is shown below.

1 SET reactorTemp TO 112.4
2
3 IF (reactorTemp >= 150.0) THEN
4     SEND "Critical" TO DISPLAY
5 END IF
6 IF (reactorTemp >= 100.0) AND (reactorTemp < 150.0) THEN
7     SEND "High" TO DISPLAY
8 END IF
9 IF (reactorTemp >= 50.0) AND (reactorTemp < 100.0) THEN
10    SEND "Normal" TO DISPLAY
11 END IF
12 IF (reactorTemp < 50.0) THEN
13    SEND "Low" TO DISPLAY
14 END IF

The programmer notes that using consecutive, independent selection statements makes this algorithm highly inefficient.

Explain how the structure and conditions of this algorithm should be modified to resolve these inefficiencies.

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