// If / else // Logical OR ( || ) // Logical AND ( && ) // Strings and string functions, // Passing variables by reference // Returns the number of days in a month int DaysInMonth( int Month, int Year) { int Days; // Check for out of range if (Month < 1 || Month > 12) Days = 0; else if (Month == 4 || Month == 6 || Month == 9 || Month == 11) Days = 30; else if (Month == 2) { Days = 28; // if year is divisible by 4, and // NOT a century year or // a century year divisible by 400 if (Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)) ++Days; } else Days = 31; return Days; } bool DateToStr( int Day, int Month, int Year, string &Date) // parameter Date passed by reference { bool RetVal = false; string Months = "JanFebMarAprMayJunJulAugSepOctNovDec"; int MonthDays = DaysInMonth(Month, Year); if (MonthDays > 0 && Day > 0 && Day <= MonthDays) { Date = StrMid(Months, (Month - 1) * 3 + 1, 3) + " " + StrMake(Day) + ", " + StrMake(Year); RetVal = true; } return RetVal; } string Date; DateToStr(28, 2, 1999, Date); return Date;