Question: I need a c++ code for the assignment #13 (pure abstract base class). it is continued in the next picture. Don't forget it has to

 I need a c++ code for the assignment #13 (pure abstract

base class). it is continued in the next picture. Don't forget it

I need a c++ code for the assignment #13 (pure abstract base class). it is continued in the next picture. Don't forget it has to accept values for the various shapes. Thanks!

Cruiseship, and Cargoship objects. (See Program 15-14, lines 17 through 22, for an example of how to do this.) The program should then step through the array, calling each object's print function 13. Pure Abstract Base Class Project Define a pure abstract base class called Basicshape. The BasicShape class should have the following members: Private Member Variable: area, a double used to hold the shape's area. Public Member Functions: getArea. This function should return the value in the member variable area calcArea. This function should be a pure virtual function. Next, define a class named circle. It should be derived from the Basicshape class. It should have the following members: Private Member Variables: centerx, a long integer used to hold the x coordinate of the circle's center centery, a long integer used to hold the y coordinate of the circle's center. radius, a double used to hold the circle's radius. Public Member Functions: constructor-accepts values for centerx, centerY, and radius overridden calcArea function described below. getcenterx-returns the value in centerx. 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

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!