Fig. 1 shows the decision structure in a bicycle-hire program. A customer enters the number of minutes a bicycle was used. The main program displays either ...

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

Question 1 Report

Fig. 1 shows the decision structure in a bicycle-hire program. A customer enters the number of minutes a bicycle was used. The main program displays either a standard charge or a late-return message.

enter minutesminutes > 120?yeslate messagenostandard charge© EAGLE BEACON GLOBAL

(a) Explain which message is displayed when minutes is 121. [1]
(b) When minutes is 120, explain which branch is followed. [1]
(c) Explain why the condition uses > rather than >=. [1]

Answer Details

(a) The condition is minutes > 120. Since 121 is greater than 120, the yes branch is followed and the late message is displayed. [1]

(b) 120 is not greater than 120, so the no branch is followed and the standard charge is displayed. [1]

(c) The program uses > because a hire lasting exactly 120 minutes is not late. Using >= would incorrectly classify it as late. [1]

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