Question: Write an algorithm to turn on / off an air condition. Given a desired set point and room temperature. If the desired set point is
Write an algorithm to turn onoff an air condition. Given a desired set point and room temperature. If the desired set point is less than the room temperature, the air condition will be turned on in "cooling" mode. If the desired set point is equal to the room temperature, the air condition will be turned on in "Fan only" mode. Otherwise, it will be turned off. You may assume that actions such as the following can be done in a single step:
comparing two numbers
turning on the air condition in "cooling mode"
turning on the air condition in "fan only mode"
turning off
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
