-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsleepIn
More file actions
24 lines (23 loc) · 967 Bytes
/
sleepIn
File metadata and controls
24 lines (23 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//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 {
public static void main(String[] args) {
boolean output = sleepIn(true, true);
System.out.println(output);
boolean output2=sleepIn(false,false);
System.out.println(output2);
boolean output3=sleepIn(true,false);
System.out.println(output3);
boolean output4=sleepIn(false, true);
System.out.println(output4);
}
//psvm--> shortcurt for main method
public static boolean sleepIn(boolean weekday, boolean vacation){
if (!weekday || vacation) {
return true;
}
return false;
}}