Skip to main content
A-LevelComputer ScienceProgramming FundamentalsOct/Nov 2024Paper 2 Q29 Marks

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() (a) By examining the program and understanding how the variables are manipulated during execution, it is evident that the calculation performed to determine `TaxPayable` is incorrect. The tax rate, being a percentage (e.g., 3.75 for 3.75%), must be divided by 100 before multiplication to get the correct decimal equivalent for the calculation. The correction required is to modify the assignment statement to: `TaxPayable ← ItemCost * (TaxRate / 100)`. (b)(i) To ensure that tax rates are consistently used and easily manageable, a more appropriate way to represent these values in the final program is to use named constants. (b)(ii) The benefits of using named constants for tax rates are that these rates only need to be entered once, reducing the potential for data entry errors and ensuring that the same rate is used throughout the program. This approach minimises the risk of accidentally changing tax rates at different points in the program. If a constant's value needs to be updated (e.g., due to a change in tax law), the change is made in a single location, which makes the program easier to maintain, modify, and understand. (c) The appropriate data types for the given variables, as used in the pseudocode, are: - `HighRate`: BOOLEAN - `TaxPayable`: REAL (d) The final `CASE` condition `> 200` in the pseudocode example could be replaced with the keyword `OTHERWISE` to handle any value not explicitly covered by the preceding conditions.

✓ Correct Answer

The correct answer is . This question tests the candidate's understanding of programming fundamentals within the Computer Sciencesyllabus. The examiner's mark scheme requires...

📋 Examiner Report & Trap Analysis

Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...

🔒

Unlock the Examiner's Answer

Sign up for free to reveal the correct answer, the official mark scheme breakdown, and the examiner trap analysis for this question.

Sign Up Free to Unlock →

Join thousands of Cambridge students already using Oracle Prep

About This A-Level Computer Science Question

This structured question appeared in the Cambridge A-Level Computer Science (9618) Oct/Nov 2024 examination, Paper 2 Variant 1. It tests the topic of Programming Fundamentals and is worth 9 marks.

Oracle Prep provides AI-powered practice for all Cambridge O-Level and A-Level subjects. Our platform includes topic predictions with 87.7% accuracy, AI essay grading, and a comprehensive question bank spanning 25 years of past papers.

© 2026 Oracle Prep — The AI-Powered Cambridge Exam Engine