#include <iostream>

using namespace std;



/////////////////////////////////////////////////////////////////////
   class Date {

        int day;
        int month; 
        int year;

     public:

        Date(int d = 1, int m = 1, int y = 2004)
            { 

              day = d; month = m; year = y;

              cout << "I just created a Date with value: "
                   << day << ' ' << month << ' ' << year << endl;

             }


        ~Date() { 

                   cout << '\n' << "I am destroying a Date with value: "
                   << day << ' ' << month << ' ' << year << endl;
                 }
        void print() { 
                   cout << day << ' ' << month << ' ' << year << endl;}

    };



/////////////////////////////////////////////////////////////////////

class Time {

      int hours;
      int mins;

 public:

      Time(int h = 0, int m = 0 ) 
          { 

             hours = h; mins = m; 
             cout << "I just created a Time with value: "
                  << hours << ' ' << mins << endl; 

          }

      ~Time() { 

                cout << '\n' << "I am destroying a Time with value: "
                     << hours << ' ' << mins << endl; }

      void print() { 
                 cout << hours <<" hours  and "<< mins <<" mins " << endl;}

};


/////////////////////////////////////////////////////////////////////

class DetailedDate{

       Date* date;
       Time* time;

      public:
        DetailedDate()
            { cout << "DetailedDate was just created with value:" << '\n' << endl;
//         CAREFUL: no space has been allocated or intialized for Date and Time

              this->date->print();   // error
              this->time->print();   // error
            }


        ~DetailedDate()
             {
               cout << '\n' 
                    << "I am destroying a DetailedDate with value: " << endl;
               date->print();
               time->print();
             }
};
 
/////////////////////////////////////////////////////////////////////

int main()
{


   DetailedDate dd1;

   return 0;
}

