Advertisement
MARINA_GREBENAROVA

Working Hours

Sep 27th, 2021
1,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Working Hours
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int hour = int.Parse(Console.ReadLine());
  10.             string day = Console.ReadLine();
  11.  
  12.             if (hour >= 10 && hour <= 18)
  13.             {
  14.                 switch (day)
  15.                 {
  16.                     case "Monday":
  17.                     case "Tuesday":
  18.                     case "Wednesday":
  19.                     case "Thursday":
  20.                     case "Friday":
  21.                     case "Saturday":
  22.                         Console.WriteLine("open");
  23.                         break;
  24.                     case "Sunday":
  25.                         Console.WriteLine("closed");
  26.                         break;
  27.  
  28.                     default:
  29.                         Console.WriteLine("closed");
  30.                         break;
  31.                 }
  32.             }
  33.             else
  34.             {
  35.                 Console.WriteLine("closed");
  36.             }
  37.  
  38.         }
  39.     }
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement