#include <iostream>
using namespace std;

//class defined page 225
class Date {
private:                                 //implied if not specified
                                         //in a class
   int d, m, y;
   static Date default_date;             //class variable
public:                                  //public interfaces of the class
   Date (int dd, int mm, int yy);        //constructor with default arguments
   static void set_default(int dd, int mm, int yy); //class method
   void add_year(int n);			      //add n years
   void add_month(int n);                //add n months
   void add_day(int n);                  //add n days
   void print_date();                    //added by Boon -- hacked iterator
};

Date Date::default_date(16, 12, 1770);      //definition of Date::default_date

void Date::set_default(int d, int m, int y) //definition of Date::set_default
{
	default_date = Date(d, m, y);          //assign a new value to default_date
}

Date::Date(int dd=0, int mm=0, int yy=0) //defined page 227
{
	this->d = dd ? dd : default_date.d;
	this->m = mm ? mm : default_date.m;
	this->y = yy ? yy : default_date.y;
	// check that date is valid code needed
}

inline void Date::add_day(int n)
{
	d += n;
}

inline void Date::add_month(int n)
{
	m += n;
}

inline void Date::add_year(int n)
{
	y += n;
}

inline void Date::print_date()
{
	cout << this->m << "/" << this->d << "/" << this->y ;
}

void f() 
{
	Date today;
	cout << "Today is: ";
	today.print_date(); 
	cout << endl;
	
	Date::set_default(2,7,2002);  //Call Data's static member function
	Date my_birthday;
	cout << "My Birthday is: ";
	my_birthday.print_date();
	cout << endl;
	
	Date date2(1,1);
	cout << "Date2 is: ";
	date2.print_date();
	cout << endl;	
	
	Date tomorrow = today;
	tomorrow.add_day(1);
}

int main()
{
	Date mydate = Date();
     f();
}
