CISC 3110 - Assignment #4 - Copy Constructors and Operator Overloading

Write the code, compile, and test the following exercise. The class interface (.h), class implementation (.cpp), and main program (.cpp) should be stored in three separate files.

Design a TestScores class that has a pointer member variable to hold test scores. The class should have a constructer that allows the user to specify the number of test scores. The constructer then dynamically allocates the memory. Demonstrate the class by writing a separate program that creates at least 2 instances of the class. The program should ask the user the number of test scores, and then define a TestScores object. The program should call the mutator function or use [] notation to prompt the user for the values, storing them in the TestScores object. Then, the program should display the TestScores in the object, by calling the accessor member function or using [] notation. Display the average of your test scores.

When you instantiate the second TestScores object, initialize it to the first object (to test the copy constructor). Then, make changes, and test the assignment operator.

Include a function that displays the set of test scores in an object. You can keep calling this function to test the contents of a TestScores object.