Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions