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.
.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-1 points
What questions did you bring for the review? Turn this in as "review.txt" (Note that you will not get points for these if the question is not actually asked during the review!)
.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":
- Has your coding style changed in the last two months? If so, how?
- Do you remember what you did in that assignment and how you
implemented it?
- Does this indicate the importance of commenting?