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

N5 Computing Science 2024 Question 7

2 marks · Selection and logical operators

State the logical operator in this code. Describe the purpose of the Boolean variable in this code. The program code below protects the rechargeable battery in an electric toothbrush. … Line 67 SET brushstop TO FALSE Line 68 WHILE brushstop = FALSE DO Line 69 Line 70 Line 71 Line 72 Line 73 SET battery TO <percentage of power left> SET temperature TO <temperature of battery> IF battery < 3 OR temperature > 45 THEN SET brushstop TO TRUE END IF Line 74 END WHILE Line 75 <switch toothbrush off> …

Marking scheme

OR • to control the loop • to switch the toothbrush off Award 1 mark for any one bullet Do not award a mark for ‘controlling whether the toothbrush is on or off

Previous question: N5 Computing Science 2024 Question 6

Next question: N5 Computing Science 2024 Question 8