Question: Design an abstract base class named BasicShape that has a private member variable: double area a public exception class: Negativevalue and the following public member
Design an abstract base class named BasicShape that has a private member variable: double area a public exception class: Negativevalue and the following public member functions: get Area accessor to area set Area mutator for area calcArea pure virtual member function Design a class named Circle derived from BasicShape that has the following private member variables: double centerx; double centerY; double radius; and the following public member functions: Constructor Circle (x, y, rad) that takes the arguments for the member variables Overridden calcArea 0, 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, 1) that takes the arguments for the member variables Overridden calcArea which returnsthe area calculated aswidth ength Demonstrate the class in a program. 1. Additional Requirements-Make sure you follow these requirements to avoid losing points a) What to turn in Your code should be structured into the following files: BaaicShape.h which contains the class definition and the inline function definitions of all the member functions for BasicShape
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
