#include <iostream>

using namespace std;



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

        int day;
        int month; 
        int year;

     public:

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

              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 DetailedPDate{

       Date* date;
       Time* time;

      public:
        DetailedPDate()
            { cout << "DetailedPDate was just created with value:" << '\n' << endl;

//              date = new Date;
//              time = new Time;
// Interchange the above with:
  time = new Time;
  date = new Date;


              date->print();     // actually this->date->print()
              time->print();

            }

         DetailedPDate(int d, int mo, int y, int h, int mi)
             { 

               cout << "DetailedPDate was just created with value:"
                    << '\n' << endl;


               date = new Date(d,mo,y);
               time = new Time(h,mi);

               date->print();
               time->print();

            }

        ~DetailedPDate()
             {

               cout << '\n' 
                    << "I am destroying a DetailedPDate with value: " << endl;

               date->print();
               time->print();

               delete date;
               delete time;


             }
};
 
/////////////////////////////////////////////////////////////////////

int main()
{


   DetailedPDate dd1;
//   DetailedPDate dd2(25,10,2005,3,45);

   return 0;

}

