Created
January 4, 2019 14:47
-
-
Save yayaenan/4dc9a1641c22505d86aea00e27f59fc2 to your computer and use it in GitHub Desktop.
yaya
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Thermostat | |
{ | |
public function thermostatController($switch,$temperature) | |
{ | |
if ($switch == "ON"){ | |
if ($temperature >= 23){ | |
return "OFF"; | |
}else{ | |
return "ON"; | |
} | |
}else{ | |
if($temperature < 5){ | |
return "ON"; | |
}else{ | |
return "OFF"; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment