Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace testrundo1
- {
- class Program
- {
- static void Main(string[] args)
- {
- var openTime = DateTime.Parse("11:00 AM");
- var closeTime = DateTime.Parse("10:00 PM");
- var lunchTime = DateTime.Parse("3:00 PM");
- Console.WriteLine(DateTime.Now);
- Console.WriteLine(openTime);
- if (openTime < DateTime.Now && DateTime.Now < lunchTime)
- Console.WriteLine("Lunch time!");
- else if
- (DateTime.Now > lunchTime && DateTime.Now < closeTime)
- Console.WriteLine("Dinner time!");
- else
- Console.WriteLine("Bummer");
- Console.ReadLine();
- }
- }
- }
- Business will open in (insert hour until opens) hour and (insert minutes until opens) minutes.
- a] If now is < 11:00 AM
- b] if now is > 10:00 PM (till next day 11:00 AM)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement