CIS 22B
Assignment Optional Extra Credit 1

Use the style guide, including Additonal styles beginning with Assignment D.

In Problem Optional Extra Credit 1 we will use an STL vector to contain the Car objects within the StringOfCar object, rather than using an array.

Problem Optional Extra Credit 1

Copy the solution from problem D2 and make the name OEC1.
Keep the same order of the functions as in problem D2.
We will keep the public interface to the StringOfCars.
We will change the implementation of the StringOfCars.
So keep all the public function prototypes in the StringOfCars.
Discard all the private data and the implementation of the member functions from the StringOfCars class; we will rebuild all of these.

Do not change anything outside the StringOfCars class.

In the StringOfCars class implementation:

Replace the private data with an STL vector of Car objects, and nothing else.

Change the default constructor so it does nothing.

Change the copy constructor so it uses the assignment operator to assign the old vector object to the vector object being constructed.

The destructor should do nothing.

Change the output function so it uses the vector size function and prints the Car objects from the vector.

Change the push function so it uses the vector push_back function to add a Car to the vector.

Change the pop function.
Use the vector back function to make a copy of the last Car object.
Use the vector pop_back function to remove the last Car object.
Put the Car object removed into the reference parameter.

Use the same tests as in problem D2.