Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started