#include <iostream>
using namespace std;
class Date
{
public :
Date(int = 1,int = 1,int = 2005);
void Display();
private:
int month;
int day;
int year;
};
Date::Date(int m,int d,int y):month(m),day(d),year(y){}
void Date::Display()
{
cout << month << "/" << day << "/" << year << endl;
}
int main()
{
Date d1(10,13,2005);
Date d2(12,30);
Date d3(10);
Date d4;
d1.Display();
d2.Display();
d3.Display();
d4.Display();
system("pause");
return 0;
}
|