Inheritance in C++. - Essay Prowess

Inheritance in C++.

Write a new version of the area calculation program from Assessment(circle and square) that makes use of inheritance in C++.

  • Add a new Shape base class to the area calculation program that includes data members common to all shapes (such as a shape ID, a shape type, and a unit of measure). The Shape base class should also include a virtual getArea() member function.
  • Revise the Circle and Square classes so that they inherit from the Shape base class.
  • Add a third shape to the program that also inherits from the Shape class. The finished program should ask the user to enter the relevant information for each shape and then print the area and other information for each shape. 
  • Organize the code correctly into header (.h) and implementation (.cpp) files. Your code should include meaningful comments and be correctly formatted.