Created
January 4, 2019 14:47
-
-
Save yayaenan/990a995803b29e23ad8331c4865c4bbb 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