Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
Question 54

Table 1 shows three tests used to check the safety configuration algorithm shown in Figure 1 for a high-pressure water turbine.

Complete the table to show what the values of the validConfig and flowSpread variables would be at the end of the first iteration for the given test data.

Figure 1

1  validConfig ← False
2  REPEAT
3      flowSpread ← -1.0
4      OUTPUT 'Enter minimum flow rate: '
5      minFlow ← USERINPUT
6      OUTPUT 'Enter maximum flow rate: '
7      maxFlow ← USERINPUT
8      IF minFlow > maxFlow THEN
9          OUTPUT 'Error: Minimum flow rate exceeds maximum'
10     ELSE
11         IF minFlow < 0.5 THEN
12             OUTPUT 'Error: Flow rate below safety critical limit'
13         ELSE
14             validConfig ← True
15         ENDIF
16     ENDIF
17 UNTIL validConfig = True
18 flowSpread ← maxFlow - minFlow
19 OUTPUT flowSpread

Table 1

Test typeTest dataValuevalidConfigflowSpread
NormalminFlow1.2
maxFlow4.8
ErroneousminFlow3.5
maxFlow2.0
BoundaryminFlow0.5
maxFlow5.5
[4]
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