Question Constellation Sign up for free

AQA · GCSE · Computer Science · Higher

Inputs producing Unknown output

Q02.5 1 mark

Figure 2 shows an algorithm, represented using pseudo-code. Line numbers are included but are not part of the algorithm.

Figure 2
1num ← USERINPUT
2IF NOT(num > 1) OR num > 20 THEN
3 OUTPUT "False"
4ELSEIF num > 1 AND num < 15 THEN
5 OUTPUT "Almost"
6ELSEIF num MOD 5 = 0 THEN
7 OUTPUT "True"
8ELSE
9 OUTPUT "Unknown"
10ENDIF

A user inputs a value into the algorithm in Figure 2. State one value that the user could input that would result in an output of Unknown.

Write your answer first. You can study the marking guidance whenever you need it.

Study the marking See what earns credit and compare it with a full-mark answer.

Marking points

  1. 1 States at least one valid Unknown-producing input: 16, 17, 18 or 19, with no incorrect value.

Full-mark answer

16

Why this answer loses marks

Any value inside the broad allowed range.

This does not trace the earlier conditions, so the proposed value could be caught by a different output branch first.