Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace testrundo1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var openTime = DateTime.Parse("11:00 AM");
  14. var closeTime = DateTime.Parse("10:00 PM");
  15. var lunchTime = DateTime.Parse("3:00 PM");
  16. Console.WriteLine(DateTime.Now);
  17. Console.WriteLine(openTime);
  18. if (openTime < DateTime.Now && DateTime.Now < lunchTime)
  19. Console.WriteLine("Lunch time!");
  20. else if
  21. (DateTime.Now > lunchTime && DateTime.Now < closeTime)
  22. Console.WriteLine("Dinner time!");
  23. else
  24. Console.WriteLine("Bummer");
  25.  
  26. Console.ReadLine();
  27. }
  28. }
  29. }
  30.  
  31. Business will open in (insert hour until opens) hour and (insert minutes until opens) minutes.
  32. a] If now is < 11:00 AM
  33. b] if now is > 10:00 PM (till next day 11:00 AM)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement