0
Can I get explained for this in Java
The parameter weekday is true if it is a weekday , and the parameter vacation is true if we are on vacation . We sleep in if it is not a weekday or we're on vacation . Return true if we sleep in.
3 Antworten
0
I tried this :
Public boolean sleepIn (boolean weekday , boolean vacation)
{
if (weekday == true || vacation == false ){
return false ;
}
return true ;
}
So I got thia and It's fel !!
SleepIn(false , false )[true] -> false
SleepIn(true , false )[false] -> false
SleepIn(false , true )[true] -> true
SleepIn(true , true )[true] -> false
0
Are you mean it is failing any case? How?
0
if (weekday == true || vacation == true ){
return true ;
}
return false;
// same as
return weekday || vacation;