Note AcademyNote Academy

Computer Science · Oct / Nov 2020 · Paper 23 · Question 2

2210

As printed in the paper

The question as text

An algorithm has been written in pseudocode to check the temperature readings taken from a freezer are within the range –18 degrees to –25 degrees inclusive. The algorithm counts the number of times that the temperature reading is below –25 degrees and the number of times that the temperature reading is above –18 degrees. An engineer is called if there are more than 10 temperature readings below –25 degrees. An alarm sounds if there are more than 5 temperature readings above –18 degrees. 01 TooHot 0 02 TooCold 1000 03 REPEAT 04 OUTPUT "Please enter temperature" 05 INPUT Temperature 06 IF Temperature < -25 07 THEN 08 TooCold TooCold – 1 09 ENDIF 10 IF Temperature > -18 11 THEN 12 TooHot TooHot + 1 13 ENDIF 14 UNTIL TooHot > 5 OR TooCold > 10 15 IF TooHot < 5 16 THEN 17 INPUT "Alarm!!" 18 ENDIF 19 IF TooCold > 10 20 THEN 21 OUTPUT "Call the Engineer" 22 ENDIF

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 2(a)[4]

  • 2(b)[4]

  • 2(c)[4]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.