#include #include // class declaration class Date { private: int month; int day; int year; public: Date(int, int, int); // constructor void showdate(); // member function to display a Date }; // implementation section Date::Date(int mm = 7, int dd = 4, int yyyy = 2001) { (*this).month = mm; (*this).day = dd; (*this).year = yyyy; } void Date::showdate() { cout << setfill('0') << setw(2) << (*this).month << '/' << setw(2) << (*this).day << '/' << setw(2) << (*this).year % 100; cout << endl; return; } int main() { Date a(4,1,1999), b(12,18,2001); // declare two objects cout << "The date stored in a is originally "; a.showdate(); // display the original date a = b; // assign b's value to a cout << "After assignment the date stored in a is "; a.showdate(); // display a's values return 0; }