Forked from 0ryant/gist:ba8a845221d8b69b6d20750d882732d9
Created
March 10, 2021 22:06
-
-
Save johnkamara/dd22c9a457e06024303f611ea6f1e44c to your computer and use it in GitHub Desktop.
Java - Coding Challenge 3 - Barking dog
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
public class BarkingDog { | |
public static boolean shouldWakeUp(boolean barking,int hourOfDay){ | |
if (hourOfDay <0 || hourOfDay >23){ | |
return false; | |
} | |
if (barking == true && hourOfDay <8 || hourOfDay >22){ | |
return true; | |
}else{ | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment