-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsleepIn.java
More file actions
24 lines (22 loc) · 750 Bytes
/
sleepIn.java
File metadata and controls
24 lines (22 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* SleepIn
* 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.
* sleepIn(false, false) → true
* sleepIn(true, false) → false
* sleepIn(false, true) → true
*/
public class sleepIn {
//Class for testing and setting dummy values
public static void main( String[] args ) {
boolean weekday = true;
boolean vacation = true;
//Output tests
System.out.println( cansleepIn(weekday, vacation) );
}
public static boolean cansleepIn(boolean weekday, boolean vacation) {
if( weekday != true || vacation == true ) {
return true;
} else {
return false;
}
}
}