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