In the recycling-centre program, a conveyor starts only when the emergency stop is not pressed and the safety gate is closed. The controller receives signal...

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

Question 1 Report

In the recycling-centre program, a conveyor starts only when the emergency stop is not pressed and the safety gate is closed. The controller receives signals from two switches. The Boolean variable stopPressed is True when the emergency button is pressed. gateClosed is True when the gate is fully shut. A technician is writing test cases for the main program and needs to include conditions that would stop the conveyor. The program must fail safely if either protective requirement is not met.

(a) Explain why the required condition can be written as NOT stopPressed AND gateClosed. [2]
(b) When stopPressed is False and gateClosed is True, state whether the conveyor may start. [1]
(c) When stopPressed is True and gateClosed is True, state whether the conveyor may start. [1]



The city bike-hire app offers a free ride extension if a rider has reported a faulty docking station or if the system has recorded a payment error. A customer service subroutine sets faultReport and paymentError. The following statement is used: extendRide = faultReport OR paymentError. A rider has made a fault report but no payment error is recorded. Another rider has neither condition recorded. Customer service needs to explain the two different displayed outcomes without changing the database records.

(a) Explain why the first rider receives an extension. [2]
(b) When both Boolean variables are False, state the value of extendRide. [1]
(c) Explain why changing OR to AND would reduce the number of riders who receive an extension. [1]

Answer Details

Recycling-centre conveyor condition

  1. (a) NOT stopPressed requires the emergency stop button not to be pressed. [1] AND gateClosed requires the gate to be closed too, because both protective conditions are required before the conveyor starts. [1]
  2. (b) If stopPressed is False, then NOT stopPressed is True. True AND True means the conveyor may start. [1]
  3. (c) If stopPressed is True, then NOT stopPressed is False. False AND True is False, so the conveyor may not start. [1]

Bike-hire extension condition

  1. (a) The first rider has faultReport=True. [1] Because OR is True when one input is True, extendRide is True and the rider receives an extension. [1]
  2. (b) False OR False gives False, so extendRide is False. [1]
  3. (c) Changing to AND would require both a fault report and a payment error. [1] Fewer riders would meet both conditions, so fewer would receive an extension.

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