Skip to content

Course home

Data types

Data types

Easy
1234567891011121314151617181920212223242526
Question 25

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]
Markscheme

Data types Questions

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

26 exam-style questions on OCR GCSE Computer Science Data types. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank