//Preconditions:None //Postconditions: a string with the date in the MM/DD/YYYY format will be returned. public override string ToString() { string result = Month.ToString("D2") + "/" + Day.ToString("D2") + "/" + Year.ToString("D4");//override the Object ToString method return(result); }
// ToString Method public override string ToString() { string dateString = Month.ToString("d2") + "/" + Day.ToString("d2") + "/" + Year.ToString("d4"); return(dateString); }
// Precondition: None // Postcondition: Creates a string in MM/DD/YYYY format public override string ToString() { string result = Month.ToString("D2") + "/" + Day.ToString("D2") + "/" + Year.ToString("D4"); return(result); }