How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Scott Your Own Question

Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

Project: Pure Abstract Base class Define a pure abstract

Customer Question

Project: Pure Abstract Base class
Define a pure 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 Functions:
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 BasicShape 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 Functions:
constructor Accepts values for centerX, centerY and radius. Should call the overridden calcArea function described below.
getCenterX return the value of centerX
getCenterY return the value of 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 Functions:
constructor accepts values for width and length. Should call the overridden calcArea function described below.
getWidth returns the value in width.
getLengh returns the value in length.
calcArea calculates the area of the rectangle (area = length * width) and stores the result in the inherited member area.
After you have created these classes, create a driver program that defines a Circle object and a Rectangle object. Demonstrate in this driver program that each object properly calculates and reports its area.
Submitted: 3 years ago.
Category: Homework
Expert:  Raj replied 3 years ago.
Hi There,

I will be helping you with the requirement.
Can i know the programming language in which you need the above requirement implemented?

Thank you
Expert:  Raj replied 3 years ago.
Do you still need the solution code?
If Answer is Yes than please let me know whether the requirement is in C++, C# XXXXX Java Programming language?
Customer: replied 3 years ago.

Hi thanks for the response but I already got it.

Expert:  Raj replied 3 years ago.
Ok no problem.

In future if you need any programming of RDBMS help than you can request me by beginning your question with TO RAJ followed by the question.

Have a Good Day.

Related Homework Questions