static void Main(string[] args) { WorkDays w; Console.Write("Year:"); string syear=Console.ReadLine(); Console.Write("Month:"); string smonth=Console.ReadLine(); Console.Write("Day:"); string sday=Console.ReadLine(); uint year = 0; uint month = 0; uint day = 0; try { year = uint.Parse(syear); month = uint.Parse(smonth); day = uint.Parse(sday); w = new WorkDays(new DateTime((int)year, (int)month, (int)day)); w.GetWorkDays(); } catch (Exception ex) { Console.WriteLine("Invalid input!"); } }
private void PrintNumberOfWorkDays(int n,WorkDays w) { Console.WriteLine("The number of workdays from today till {0} is {1}",w.date,n); }