Question: Create psuedocode Question 2: Shape Define a pure abstract base class called Basic shape. The BasicShape class should have the following members Private Member Variable

Create psuedocode Create psuedocode Question 2: Shape Define a pure abstract base class called

Question 2: Shape Define a pure abstract base class called Basic shape. The BasicShape class should have the following members Private Member Variable w dobe used to hold the shape's rea, Pitilic Member Function Area. This function should return the value in the mentbervariable area calcare. This function should be a pure virtual function Net, derfor a clau named Circle. It should be derived from the BaskeShape cle. I should have the following members Private Member Variables Cemer a long integer med to hold the x coordinate of the circle's center center a long integer used to hold the y coordinate of the circles center radhus, a double sted to hold the chicles radar Public Member Functions contructor-accents values for centerX centery, and radiun. Should call the averidden cak Area function described below. petCenter-returns the value in center Center-returns the value in centery, calcre-colates the area of the circle (area = 3.14159"radius radius) and stores the result in the inherited member area. Next define a cas named Rectangle. It should be derived from the Base Shape 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 uted to hold the length of the rectangle Pib Member functions constructor accepts values for width and length Should call the overridden Calcarea function described below - Width-returns the value in width pettength returns the value in length CalcArea-calculates the area of the rectangle farea-length width) and stores the result in the inherited member area After you have created these cases, create a driver program that defines a Circle object and a Rectangle object. Demonstrate that each object property calculates and reports its are

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!