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.
(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]
(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]
Everything you need to excel in your exams