Skip to content

This is a solution to the pre-release material in the O/N 2015 exam series.

Notifications You must be signed in to change notification settings

v1peridae/temperature-check-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Description

  • This is a solution for the question below:

    • Write and test a program to complete the three tasks. The temperature in an apartment needs to be kept between 22°C and 24°C. This is done by the use of an automatically controlled air-conditioning system, which monitors the temperature every five minutes. The temperature of the apartment is recorded, to one decimal place, in degrees Celsius. The cooling is activated when the temperature reaches 24.5°C and the heating is activated when the temperature reaches 21.5°C.

    TASK 1

    • To simulate the monitoring required, write a routine that allows entry of the apartment’s temperature in degrees Celsius. The routine checks whether the temperature is within the acceptable range, too high or too low and outputs a suitable message in each case.

    TASK 2

    • Write another routine that stores, in an array, the temperatures taken over a period of five hours. This routine calculates the difference between the highest temperature and the lowest temperature. Then it outputs the highest temperature, the lowest temperature, and the difference between these temperatures.

    TASK 3

    • Write a routine to find out how often the temperature was out of the acceptable range during the five hours and whether the temperature was too high or too low; output a suitable message showing a summary of the problem.

About

This is a solution to the pre-release material in the O/N 2015 exam series.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages