(5/5)

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

INSTRUCTIONS TO CANDIDATES

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;

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

(5/5)

## Related Questions

##### . Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

##### . The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

##### . Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

##### . SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

##### . Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Hire Me

Hire Me