Skip to content

Instantly share code, notes, and snippets.

@ilialloyd
Created September 1, 2022 03:08
Show Gist options
  • Save ilialloyd/65d6e684830cd9366dc3d058e41df232 to your computer and use it in GitHub Desktop.
Save ilialloyd/65d6e684830cd9366dc3d058e41df232 to your computer and use it in GitHub Desktop.
Coding Exercise 11: Playing Cat
public class PlayingCat {
// write your code here
public static boolean isCatPlaying(boolean summer, int temperature){
while (summer == false) { //if it is nut summer
if (!(temperature >= 25 && temperature <= 35)) { //setting temperature
return false;
}else {
return true;
}
}
while (summer == true) { //if it is summer
if (!(temperature >= 25 && temperature <= 45)) { //setting summer temperature
return false;
}else {
return true;
}
}
return summer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment