Computer Science · Oct / Nov 2024 · Paper 21 · Question 9
0478
As printed in the paper
The question as text
An algorithm has been written in pseudocode to check if a temperature is in a given range. The temperature values used in the algorithm are correct. « ¼«¼ ½«²¾¬¾ ¾¿¹¾° ¹¾ÀÁ¾°¬¹Â°¾ ½ «¼ ¾ÀÁ ¾ÀÁ¾°¬¹Â°¾ à ¾ÀÁ¾°¬¹Â°¾ Ä ¸ ¼«¼ ½¾ÀÁ¾°¬¹Â°¾ ¹¯¯ ÅÆÇŽ ¾ÀÁ¾°¬¹Â°¾ È ¸ ¼«¼ ½¾ÀÁ¾°¬¹Â°¾ ¹¯¯ ²¯®½ ¾ÀÁ¾°¬¹Â°¾ Äà ¸ ¾ÀÁ¾°¬¹Â°¾ Èà ¸ ¼«¼ ½¾ÀÁ¾°¬¹Â°¾ ¿¯°À¬²½ É ¾ÀÁ¾°¬¹Â°¾ Ã
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
9(a)[4]
One mark for each error identified and correction:
Line 03 Temp should be TemperatureLine 04 = should be <>Line 14 OR should be ANDLine 19 WHILE should be UNTIL01 REPEAT
02 OUTPUT "Please enter temperature "
03 INPUT Temperature
04 IF Temperature <> 999
05 THEN
06 IF Temperature > 38.0
07 THEN
08 OUTPUT "Temperature too high"
09 ENDIF
10 IF Temperature < 35.0
11 THEN
12 OUTPUT "Temperature too low"
13 ENDIF
14 IF Temperature >= 35.0 AND Temperature <= 38.0
15 THEN
16 OUTPUT "Temperature normal"
17 ENDIF
18 ENDIF
19 UNTIL Temperature = 999
9(b)[2]
One mark for each point
greater than or equal to 35and less than or equal to 389(c)[2]
One mark for each correct column max two
Temperature
OUTPUT
(Please enter temperature)
34.22
Temperature too low
(Please enter temperature)
36.1
Temperature normal
(Please enter temperature)
37.4
Temperature normal
(Please enter temperature)
38.0
Temperature normal
(Please enter temperature)
999
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

