-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkingTime.java
More file actions
28 lines (27 loc) · 832 Bytes
/
Copy pathworkingTime.java
File metadata and controls
28 lines (27 loc) · 832 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
25
26
27
28
import java.util.Scanner;
public class workingTime {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
short hours = Short.parseShort(scanner.nextLine());
String day = scanner.nextLine();
switch (day) {
case "Monday":
case "Tuesday":
case "Wednesday":
case "Thursday":
case "Friday":
case "Saturday":
if (hours <=18 && hours >=10){
System.out.println("open");
}else{
System.out.println("closed");
}
break;
case "Sunday":
System.out.println("closed");
break;
default:
System.out.println("Error");
}
}
}