Note AcademyNote Academy

Computer Science (AS & A Level) · Oct / Nov 2024 · Paper 21 · Question 2

9618

As printed in the paper

The question as text

A program uses three global integer variables HH, MM and SS to represent the current time in hours, minutes and seconds using the 24-hour clock notation. Midnight would be represented as 00:00:00 (HH:MM:SS). If the variables HH, MM and SS contained the values 16, 30 and 10 respectively, then the time would be 16:30:10 or just after 4.30 in the afternoon. A procedure Tick() will be called every second. The procedure Tick() will: • update the value in SS each time it is called • update the values in HH and MM as appropriate • call a procedure CheckAlarm() at the start of each minute • call a procedure NewDay() whenever the time reaches midnight. Complete the pseudocode for procedure Tick(). PROCEDURE Tick() ENDPROCEDURE [6]

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

Show the answer and mark scheme

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