Advertisement
AngelKejov

Untitled

Mar 21st, 2021
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class WorkingHours {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.  
  10.         int hour = Integer.parseInt(sc.nextLine());
  11.         String day = sc.nextLine();
  12.  
  13.         if (hour > 10 && hour < 19) {
  14.             switch (day) {
  15.                 case "Monday":
  16.                 case "Tuesday":
  17.                 case "Wednesday":
  18.                 case "Thursday":
  19.                 case "Friday":
  20.                 case "Saturday":
  21.                     System.out.println("open");
  22.                     break;
  23.  
  24.                 default:
  25.                     System.out.println("closed");
  26.             }
  27.         } else {
  28.             System.out.println("closed");
  29.         }
  30.     }
  31. }
  32.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement