Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

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_2

Step: 3

blur-text-image_3

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions