The town council's recycling app calculates collection dates. A function called nextCollection(dayNumber) returns the day number of the next collection. The...

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

Question 1 Report

The town council's recycling app calculates collection dates. A function called nextCollection(dayNumber) returns the day number of the next collection. The main program then calls a procedure named displayDate(dayNumber) to show the result in a message for a resident. A programmer has confused the two types of subroutine while revising the skeleton program. The council must be able to reuse the date calculation in both its website and its phone app.

(a) Explain the difference between the purpose of nextCollection and displayDate. [2]
(b) When the main program needs to store the calculated day in a variable, state which subroutine type is required. [1]
(c) Explain one advantage of reusing the same date-calculation function in both programs. [1]



A cinema booking program contains the procedure reserveSeat(row, seat). It checks whether the requested square on the seating board is empty. If it is empty, the procedure changes the board and displays a confirmation message. The programmer needs to ensure that the values supplied in the call match the parameters in the subroutine header. A customer has selected row 6 and seat 14. The following call is used: reserveSeat(6, 14).

(a) Explain what is meant by an argument in this call. [2]
(b) When the procedure starts, state the value held by parameter row. [1]
(c) Explain why the order of the two arguments is important. [1]

Answer Details

Collection-date program

  1. nextCollection calculates and returns a day-number value. displayDate performs output by displaying that value and does not need to return one. [2]
  2. A function is required when the main program needs to store a calculated day in a variable. [1]
  3. Reusing one tested date-calculation function avoids duplicated code and ensures that any rule changes are consistent in both programs. [1]

Cinema reservation

  1. An argument is a value supplied when a subroutine is called. It is passed to the corresponding parameter, so in reserveSeat(6, 14), the values are supplied to row and seat. [2]
  2. Parameter row holds 6. [1]
  3. Argument order matters because the first value is assigned to row and the second to seat. Reversing them could reserve the wrong position. [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