A wildlife camera program sends a new message to researchers when movement is detected at night but the camera is not in maintenance mode. The sensor subrou...

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

Question 1 Report

A wildlife camera program sends a new message to researchers when movement is detected at night but the camera is not in maintenance mode. The sensor subroutine gives movement, the clock subroutine gives night, and an engineer sets maintenance. The program uses sendMessage = movement AND night AND NOT maintenance. During field testing, an animal moves during the day. In another test, movement occurs at night while maintenance is enabled. Researchers need to understand why neither event should send a message.

(a) Explain why maintenance mode is negated in the statement. [2]
(b) When movement is True, night is False and maintenance is False, state the value of sendMessage. [1]
(c) When movement is True, night is True and maintenance is True, state the value of sendMessage. [1]
(d) Explain why AND is suitable for the three checks. [1]



Fig. 1 shows part of the access-control program used at a community workshop. A member may use the laser cutter only if their card is valid and they have completed safety training. The two input values are stored as Boolean variables. The main program displays a message telling the member whether access is allowed. The programmer wants the condition to be clear so that a technician can test it using all possible input combinations.

cardValidaccessAllowedANDtrained

(a) Explain when accessAllowed is True. [2]
(b) When cardValid is False and trained is True, state the value displayed for accessAllowed. [1]

Answer Details

Wildlife-camera condition

  1. (a) Messages must not be sent during maintenance. [1] Therefore maintenance must be False, represented by NOT maintenance being True. [1]
  2. (b) True AND False AND True is False, so sendMessage is False. [1]
  3. (c) True AND True AND NOT True is True AND True AND False, so sendMessage is False. [1]
  4. (d) AND is suitable because all three required conditions must be satisfied: movement, night-time, and no maintenance mode. [1]

Workshop access condition

  1. (a) accessAllowed is True only when the card is valid [1] and safety training is complete, so trained is True. [1]
  2. (b) False AND True is False, so accessAllowed displays False. [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