Created
February 4, 2017 10:50
-
-
Save mallibone/6de3744a2b0811dc882f933d21238e59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace ConsoleApplication | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
StringBuilder messageOfTheDay = new StringBuilder(); | |
var currentDate = DateTime.Now; | |
if(currentDate.Day % 2 != 0) | |
{ | |
messageOfTheDay.Append("Today is an odd Day, "); | |
} | |
else | |
{ | |
messageOfTheDay.Append("Today all should be even, "); | |
} | |
switch(currentDate.DayOfWeek) | |
{ | |
case DayOfWeek.Monday: | |
case DayOfWeek.Tuesday: | |
case DayOfWeek.Wednesday: | |
case DayOfWeek.Thursday: | |
case DayOfWeek.Friday: | |
messageOfTheDay.Append("that being said you should be working..."); | |
break; | |
case DayOfWeek.Saturday: | |
case DayOfWeek.Sunday: | |
messageOfTheDay.Append("yay it's the Weekend!!!"); | |
break; | |
default: | |
throw new InvalidOperationException("This program only knows the 7 weekdays...."); | |
} | |
Console.WriteLine(messageOfTheDay.ToString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment