In the final test of a sailing-club booking program, a family hires kayaks for 155 minutes. The club charges £9 for each complete 30-minute period and then ...

Assessment: Computer Science 9210 | Paper 1 Mock 01 | Programming (on-screen) Subject: Computer Science - 9210

Question 1 Report

In the final test of a sailing-club booking program, a family hires kayaks for 155 minutes. The club charges £9 for each complete 30-minute period and then £4 for any remaining time. The skeleton program contains the variables periods, extraMinutes and cost. The programmer must use integer arithmetic to separate complete periods from the final part of the hire. The result is displayed to the customer before payment. The following rules apply: complete periods are charged at £9, and any non-zero remainder receives one £4 charge.

(a) When periods = 155 DIV 30 is executed, state the value of periods. [1]
(b) When extraMinutes = 155 MOD 30 is executed, state the value of extraMinutes. [1]
(c) Explain why a test of extraMinutes > 0 is needed before adding £4. [2]
(d) When the family has hired the kayaks for 155 minutes, calculate the total cost. Show your working. [2]
(e) Explain one advantage of storing 30 and 9 in named variables rather than repeatedly typing these values in the program. [2]
(f) When the hire lasts exactly 150 minutes, state the total cost. [4]

Answer Details

(a) \(155 \operatorname{DIV} 30 = 5\), so periods is 5. [1]

(b) \(155 \operatorname{MOD} 30 = 5\), so extraMinutes is 5. [1]

(c) A positive remainder means there is hire time beyond the complete 30-minute periods, so one £4 charge is needed. If the remainder is zero, adding £4 would charge the customer incorrectly. [2]

(d) \[5 \times £9 = £45\]
There are extra minutes, so:
\[£45 + £4 = £49\]
The total cost is £49. [2]

(e) Named variables give values such as 30 and 9 meaningful names, making the code easier to read. If a tariff changes, it is edited in one place; this also reduces typing errors and inconsistent values. [2]

(f) \[150 \operatorname{DIV} 30 = 5\text{ periods}\]
\[150 \operatorname{MOD} 30 = 0\]
There is no remaining time, so no extra £4 is added.
\[5 \times £9 = £45\]
The total cost is £45. [4]

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning