Pointers, Arrays, and Classes, Oh My!

Note This lab is intended to be fairly short, a large portion of the class will be devoted to review for the Final Exam. We will not introduce any new material in this lab. Instead, we focus on putting together several things you have been learning over the past few weeks.

The Assignment

7 points Implement a class that has two constructors, one of which takes no values. Also implement a second class that inherits from that class. (A good example would be a class Point which has values x and y, and a derived class Point3d that has values x, y, and z, but you use whatever you like.)

In main(), prompt the user for how many of each class they would like to create, and then dynamically allocate an array of that many of each class.

.4 points Break up your program into main.cc and a appropriate header and implementation files (point.cc and point.h, for example). Remember to never #include a .cc file.

.2 points After splitting into seperate files as described above, write a Makefile to compile your submission.

.2 points Which constructor (if any) is used when you dynamically allocate an array of objects?

.2 points Add in a static member to track the number of objects that have been allocated.

.2 points If you still have your code from earlier labs, go back and look at one of your earlier lab assignments (lab 2 or 3 if possible.) Answer the following questions in a file called "questions.txt":