Question: Public Member Functions: constructor: accepts values for center X, center Y, and radius. Should call the overridden calcArea function described below. getCenter X : returns

Public Member Functions: constructor: accepts values for center X, center Y, and radius. Should call the overridden calcArea function described below. getCenter X : returns the value in center X getCentery: returns the value in centery calcArea: calculates the area of the circle (area =3.14159 radius * radius) and stores the result in the inherited member area. Next, define a class named Rectangle. It should be derived from the Basicshape class. It should have the following members: Private Member Variables: width: a long integer used to hold the width of the rectangle length: a long integer used to hold the length of the rectangle Public Member Functions: constructor: accepts values for width and length. Should call the overridden calcArea function described below. getWidth: returns the value in width. getLength: returns the value in length. calcArea: calculates the area of the rectangle (area = length * width) and stores the result in the inherited member area. After you have created these classes, create a driver program that defines a Circle object and a Rectangle object. Demonstrate that each object properly calculates and reports its area
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
