id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > sleepingCats
prev  |  next  |  chance

Write a method called "sleepingCats" that returns true if the sleeping cats will stay asleep when you enter the room, or returns false if they will wake up when you enter the room. The cats will only stay asleep if there are 5 or fewer cats in the room, unless they just ate dinner in which case they will only stay asleep if there are 8 or fewer cats in the room. The parameter justAte is true if the cats just ate dinner, but is false otherwise.


sleepingCats(3, true) → true
sleepingCats(4, false) → true
sleepingCats(5, false) → true

...Save, Compile, Run (ctrl-enter)

public boolean sleepingCats(int howManyCats, boolean justAte) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 110

Copyright Nick Parlante 2017 - privacy