Interested in a PLAGIARISM-FREE paper based on these particular instructions?...with 100% confidentiality?

Order Now

Define an abstract base class called BasicShape. The BasicShape class should have the following members: Private member variable: • area – a double used to hold the shape’s area. Public member methods: • getArea – this function should return the value in the member variable area. • calcArea – this function should be a pure virtual function. Next, define a class named Circle. It should be derived from the Basic Shape class. It should have the following members: Private member variables: • centerX – a long integer used to hold the x coordinate of the circle’s center. • centerY – a long integer used to hold the y coordinate of the circle’s center. • radius – a double used to hold the circle’s radius. Public member methods: • constructor – accepts values for centerX, centerY, and radius. Should call the overridden calcArea function describe below. • getCenterX – returns the value in centerX. • getCenterY – returns the value in centerY. calcArea – calculates the area of the circle (area = 3.14159 * radius * radius) and stores the result in the inherited member area. Next, define a class named rectangle. It should be derived from the BasicShape class. It should have the following members: Private member variables: • width – a long integer used to hold the width of the rectangle. • length – a long integer used to hold the length of the rectangle. Public member methods: • constructor – accepts values for the width and length. Should call the overridden calcArea function described below. • getWidth – returns the value in width. • getLength – returns the value in length. • calcArea – calculates the area of the rectangle (area = length * width) and stores the result in the inherited member area. Next write a menu-driven program that creates a circle and rectangle, reads their details from standard input and tests their member functions.

Define an abstract base class called BasicShape. The BasicShape class should have the following

members:

Private member variable:

• area – a double used to hold the shape’s area.

Public member methods:

• getArea – this function should return the value in the member variable area.

• calcArea – this function should be a pure virtual function.

Next, define a class named Circle. It should be derived from the Basic Shape class. It should have

the following members:

Private member variables:

• centerX – a long integer used to hold the x coordinate of the circle’s center.

• centerY – a long integer used to hold the y coordinate of the circle’s center.

• radius – a double used to hold the circle’s radius.

Public member methods:

• constructor – accepts values for centerX, centerY, and radius. Should call the overridden

calcArea function describe below.

• getCenterX – returns the value in centerX.

• getCenterY – returns the value in centerY.

calcArea – calculates the area of the circle (area = 3.14159 * radius * radius) and stores

the result in the inherited member area.

Next, define a class named rectangle. It should be derived from the BasicShape class. It should

have the following members:

Private member variables:

• width – a long integer used to hold the width of the rectangle.

• length – a long integer used to hold the length of the rectangle.

Public member methods:

• constructor – accepts values for the width and length. Should call the overridden calcArea

function described below.

• getWidth – returns the value in width.

• getLength – returns the value in length.

• calcArea – calculates the area of the rectangle (area = length * width) and stores the result

in the inherited member area.

Next write a menu-driven program that creates a circle and rectangle, reads their details from

standard input and tests their member functions.

Interested in a PLAGIARISM-FREE paper based on these particular instructions?...with 100% confidentiality?

Order Now