In the final stage of a greenhouse program, a heater is switched on if the soil temperature is too low. The sensor value is stored in soilTemp in degrees C....

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

Question 1 Report

In the final stage of a greenhouse program, a heater is switched on if the soil temperature is too low. The sensor value is stored in soilTemp in degrees C. The grower wants the heater on at 8 degrees C and at every value below 8 degrees C. A trainee writes this condition:

IF soilTemp < 8 THEN
heaterOn = TRUE
ENDIF

(a) Explain the result of the relational test when soilTemp is 7.5. [1]
(b) When soilTemp is exactly 8, explain why the heater remains off. [1]
(c) When the grower's requirement is implemented, write the condition that should be used. [1]

Answer Details

(a) When soilTemp is 7.5, the test soilTemp < 8 is true because 7.5 is less than 8. [1]

(b) At exactly 8, the test is false because 8 is not less than 8. Therefore the displayed code does not switch the heater on. [1]

(c) The requirement includes 8 and all lower temperatures, so the correct condition is soilTemp <= 8. [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