Question: Design an abstract base class named Basic Shape that has a private member variable: double area a public exception class: Negative value and the following

 Design an abstract base class named Basic Shape that has aprivate member variable: double area a public exception class: Negative value and

the following public member functions: getArea accessor to area set Area mutator

for area calcArea pure virtual member function Design a class named Circle

derived from Basic Shape that has the following private member variables: double

cent double cent double radius; and the following public member functions: Constructor

Design an abstract base class named Basic Shape that has a private member variable: double area a public exception class: Negative value and the following public member functions: getArea accessor to area set Area mutator for area calcArea pure virtual member function Design a class named Circle derived from Basic Shape that has the following private member variables: double cent double cent double radius; and the following public member functions: Constructor Circle (x, y, rad) that takes the arguments for the member variables Overridden calcArea which returns the area calculated as 3.14159 radius radius Design a class named Rectangle derived from BasicShape that has the following private member variables: double width. double length and the following public member functions: Constructor Rectangle (w l) that takes the arguments for the member variables Overridden calcArea which returns the area calculated as width length Demonstrate the class in a program

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!