Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnkamara/dd22c9a457e06024303f611ea6f1e44c to your computer and use it in GitHub Desktop.
Save johnkamara/dd22c9a457e06024303f611ea6f1e44c to your computer and use it in GitHub Desktop.
Java - Coding Challenge 3 - Barking dog
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