7. Working Hours (Long Solution)
Ivan Ivanov
Posted on January 20, 2023
using System;
namespace WorkingHours
{
internal class Program
{
static void Main(string[] args)
{
int dayHour = int.Parse(Console.ReadLine());
string weekDay = Console.ReadLine();
switch (weekDay)
{
case "Monday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("open");
}
else
{
Console.WriteLine("closed");
}
break;
case "Tuesday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("open");
}
else
{
Console.WriteLine("closed");
}
break;
case "Wednesday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("open");
}
else
{
Console.WriteLine("closed");
}
break;
case "Thursday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("open");
}
else
{
Console.WriteLine("closed");
}
break;
case "Friday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("open");
}
else
{
Console.WriteLine("closed");
}
break;
case "Saturday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("open");
}
else
{
Console.WriteLine("closed");
}
break;
case "Sunday":
if (dayHour >= 10 && dayHour <= 18)
{
Console.WriteLine("closed");
}
break;
}
}
}
}
💖 💪 🙅 🚩
Ivan Ivanov
Posted on January 20, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.