Please complete this code in C++ and attach screenshots of your input and output
ID: 3716573 • Letter: P
Question
Please complete this code in C++ and attach screenshots of your input and output. Along with main.cpp, Rectangle.h, Circle.h, and BasicShape.c, please include Rectangle.cpp, Circle.cpp, and BasicShape.cpp. Thank you
Design an abstract base class named BasicShape that has a private member variable a public exception class and the following public member functions double area NegativeValue getArea) accessor to area . setArea (area) mutator for area . calcArea () pure virtual member function that returns a double Design a class named Circle derived from BasicShape that has the following private member variables double center; » double radius; * Constructor Circle (centerX_, centerY_, radius_) that takes the arguments and double centerY; and the following public member functions sets the member variables. The area should be set by calling calcArea then setArea. The constructor must throw the NegativeValue exception if any of the argument values is negative 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 (width_, length_) that takes the arguments and sets the member variables. The area should be set by calling calcArea then setArea. The constructor must throw the NegativeValue exception if any of the argument values is negative . Overridden calcArea (), which returns the area calculated as width * length Demonstrate the class in a programExplanation / Answer
main.cpp
Circle.cpp
#include "Circle.h"
Circle.h
Rectangle.cpp
Rectangle.h
BasicShape.h
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.