ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions

N5 Computing Science 2016 Question 9

2 marks · Fixed and conditional loops

This code design monitors the temperature of food as it is reheated. Line 1 RECEIVE temperature FROM (REAL) <temperature sensor> Line 2 WHILE temperature < 82 DO Line 3 SEND “temperature too low: continue to reheat” TO DISPLAY Line 4 RECEIVE temperature FROM (REAL) <temperature sensor> Line 5 END WHILE Explain what will happen in lines 2 to 5 if the sensor detects 63°.

Marking scheme

All three bullets for 2 marks: • program loops/ program repeats lines 3 and 4 / program checks condition • a message is displayed • another temperature reading is taken Any two bullets for 1 mark. One or zero bullets, no marks. Candidate can imply loop through an idea of repetition (for example - “until temperature is greater than 82” or “until” or “while”) Note – Candidate must “explain” what the code does. If they simply copy the code into their answer they should not be awarded that bullet point.

Previous question: N5 Computing Science 2016 Question 8

Next question: N5 Computing Science 2016 Question 10