Advertisement
desislava_topuzakova

07. Working Hours

Jan 22nd, 2022
1,046
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class WorkingHours {
  4.     public static void main(String[] args) {
  5.  
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int hour = Integer.parseInt(scanner.nextLine());
  10.         String dayOfWeek = scanner.nextLine();
  11.  
  12.         if(hour >= 10 && hour <= 18 && !dayOfWeek.equals("Sunday")){
  13.             System.out.println("open");
  14.         }
  15.         else System.out.println("closed");
  16.  
  17.     }
  18. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement