private static HypoDate ReadDate() { var year = ReadYear(); var month = ReadMonth(); var day = ReadDay(month, year); var date = new HypoDate(year, month, day); return(date); }
private static int ReadDay(int month, int year) { var maxDay = HypoDate.GetMaxDaysPerMonthList(year)[month]; var day = 0; do { Console.WriteLine("Please, enter a day for the month {0} of the year {1}. A day between 1 and {2}.", month, year, maxDay); day = ReadInteger(); }while (day < 1 || day > maxDay); return(day); }
private static void PrintReport(HypoDate from, HypoDate to) { var days = HypoDate.GetElapsedDays(from, to); Console.WriteLine("Report: The experiment has taken {0} days.", days); }
private static bool IsValidRange(HypoDate from, HypoDate to) { return(@from.AbsoluteDays <= to.AbsoluteDays); }
public static int GetElapsedDays(HypoDate from, HypoDate to) { return(to.AbsoluteDays - from.AbsoluteDays - 1); // Discounts no fully elapsed day. }