desislava_topuzakova

Untitled

Jun 20th, 2021
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class WorkingHours {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int hour = Integer.parseInt(scanner.nextLine());
  8. String day = scanner.nextLine();
  9.  
  10. if (hour >= 10 && hour <= 18) {
  11. switch (day){
  12. case "Monday":
  13. case "Tuesday":
  14. case "Wednesday":
  15. case "Thursday":
  16. case "Friday":
  17. case "Saturday":
  18. System.out.println("open");
  19. break;
  20. default:
  21. System.out.println("closed");
  22. break;
  23. }
  24. } else {
  25. System.out.println("closed");
  26. }
  27. }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment