Data types
25
0/1

An automated climate control system uses codes to identify different heating zones in a smart building. The code for each zone type is shown in the table:

Zone CodeZone Name
HWHallway
KTKitchen
BDBedroom

A program is written to process temperature adjustments. The program:

  • asks the user to enter the zone code for the heating zone they want to adjust
  • calls the function IsActiveZone() to check whether the entered zone is currently active and configurable
  • asks for the target temperature if the zone is active
01  zoneCode = input("Enter the heating zone code")
02  if IsActiveZone(zoneCode) then
03      targetTemp = input("Enter the target temperature in Celsius")
04      print("Setting zone " + zoneCode + " to " + targetTemp + " degrees.")
05  endif

Identify the data type of the value returned by the function IsActiveZone().

[1]

Data types Questions

Practise OCR GCSE Computer Science Data types with exam-style questions for GCSE Computer Science. 26 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types