Define a class hierarchy with the following structure. You get to pick the problem domain, and I suggest you pick something you would like to work on in the future. Here are the details:

  • Define a class hierarchy with the following structure. You get to pick the problem domain, and I suggest you pick something you would like to work on in the future. Here are the details:
  • Derive three classes directly from your abstract base class and make them concrete by providing implementations for the virtual function you introduced in your abstract base class. The methods for each of these three classes must actually behave differently from one another (example: Circle area vs. Square area vs. Triangle area each use a different formula).
  • Write one interesting polymorphic function that operates on any type derived from your abstract base class. It should take a list (or array) of instances of your abstract base class (e.g., Shape *) and call the virtual function on each to do something interesting. Also, have each of these virtual functions print something so you can see which is being called.
  • Write a main program that builds a list (or array) of several instances of each of your concrete classes, then pass this off to your polymorphic function.
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.