Homework: The "Big Five"

  < Previous  Next >

For this homework assignment, write the prototypes and the definitions for:
  1. A default constructor
  2. The "Big Five" (as defined in Section 1.5.6)
for the Family class in hwkBigFive.cpp. Include the name of each of the Big Five in comments (both before each declaration and before each implementation).
Your output should match the output in hwkBigFive-stdout.txt exactly:
Family copyCatFamily( happyFamily );

Printing happyFamily...
Family member index 0: Mom
Family member index 1: Dad
Family member index 2: Daughter
Family member index 3: Son

Printing copyCatFamily...
Family member index 0: Mom
Family member index 1: Dad
Family member index 2: Daughter
Family member index 3: Son

jonesFamily = happyFamily;

Printing happyFamily...
Family member index 0: Mom
Family member index 1: Dad
Family member index 2: Daughter
Family member index 3: Son

Printing jonesFamily...
Family member index 0: Mom
Family member index 1: Dad
Family member index 2: Daughter
Family member index 3: Son

Family changFamily( std::move( happyFamily));

Printing happyFamily...

Printing changFamily...
Family member index 0: Mom
Family member index 1: Dad
Family member index 2: Daughter
Family member index 3: Son

smithFamily = std::move( copyCatFamily);

Printing copyCatFamily...

Printing smithFamily...
Family member index 0: Mom
Family member index 1: Dad
Family member index 2: Daughter
Family member index 3: Son

Submission

Submit your .cpp file at https://3110.cs.mtsu.edu/. For further instructions, please see the Miscellaneous page.

Rubric:

Points          Item
----------      --------------------------------------------------------------
_____ /  1      Default constructor
_____ /  2      Big Five #1
_____ /  2      Big Five #2
_____ /  2      Big Five #3
_____ /  2      Big Five #4
_____ /  2      Big Five #5
        
_____ / 11      Total
      

Notes

  1. Part of the grading process is automated by using diff. You should verify that your output matches the above output exactly with the following commands on ranger:
    g++ -std=c++0x hwkBigFive.cpp -o hwkBigFive
    ./hwkBigFive &> hwkBigFive-yourlastname.txt
    diff /nfshome/hcarroll/public_html/3110/private/hwk/hwkBigFive-stdout.txt hwkBigFive-yourlastname.txt

    If the two files match exactly (which is what you want) then there should be NO output from diff. If diff shows one or more differences, fix them and run it again. To get side-by-side output (with the answer key on the left and your output on the right), replace the last line with:
    diff --side-by-side ...

Last Modified: