CS 1440 Lab 8

Cover sheetPrevious Activity                                                      Post-Lab


 

  1. Copy your Act2.C file into a Date.h and a Date.C files.
  2. Copy your Act3.C file into a Person.h and a Person.C files.
  3. Edit these class header files to contain only their class definitions.
  4. Edit these class implementation files to contain only their class function implementations.
  5. Write a new class called “Couple”.  A couple contains two Persons as data members, and set and Display member functions as shown below.  You decide what displaying a couple might do.  Maybe output like:  “Charlie will occasionally forget Trish’s birthday on 10/19/1975, but Trish will never forget Charlie’s 9/26/1974 birthday.”
  6. Use the following main function in file called postlab.C and also implement the getPerson function.

    int  main()
    {
         Person  he, she;
         Couple  them;

         she = getPerson();
         he = getPerson();

         them.set(she, he);
         them.Display();
    }
    Person  getPerson()
    {
         Person  p;
         /*  YOU  DO  IT!  */
         return p;
    }

  7. Compile everything together:
                g++  Date.C  Person.C  Couple.C  postlab.C