This homework assignment gives you the opportunity to practice inheritance, pure virtual member functions, abstract base classes, and exceptions.C++ Programming

Students:

This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor. If you have any technical issues with the zyLab submission system, use the Trouble with lab button at the bottom of the lab.                   

1.14 HW11

This homework assignment gives you the opportunity to practice inheritance, pure virtual member functions, abstract base classes, and exceptions.

HW11 (100 points)

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:

  • 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 centerX;

  • double centerY;

  • double radius;

and the following public member functions:

  • Constructor Circle(centerX_, centerY_, radius_) that takes the arguments and sets the member 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 14159* radius * radius

Attachments:

Instructions Files

C++ Programming Experts

expert
Eric Bell
C++ Programming

88 Answers

expert
Dinh Hong P.
C++ Programming

20 Answers

View More Experts
Disclaimer

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.

Get Free Quote!

263 Experts Online