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