Computer Science Homework Solutions
Problem
#101955

C++ Programming

Create a class named RealtorCommission.  Fields include the sale price of a house, the sales commission rate, and the commission.  Create two constructors.  Each constructor requires the sales price (expressed as a double) and the commission rate.  One constructor requires the commission rate to be double, such as .06.  The other requires the sale price and the commission rate expressed a whole number, such a 6,  Each constructor calculates the commission value based on the price of the house multiplied by the commission rate.  The difference is that the constructor that accepts the whole number must convert it to a percentage by dividing by 100.  Also include a display function for the fields contained in the RealtorCommission class.  Also include a main() program that instantiates at least two RealtorCommission objects--one that uses a decimal and one that uses a whole number as the commission rate.  Display RealtorCommission object values.  Finally implement the corresponding destructors.

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • 101955-Realtor.cpp
    • 101955-Realtor.exe
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • C++ Programming - A CollegeCourse class includes fields representing department, course number, credit hours, and tuition. Its child, LabCourse, includes one more field that holds a lab fee charged in addition to the ...
  • 13365 Programming > C++ - I am attempting to complete Assignemt Exercise 13.12 in the Deitel&Deitel 5th edition version of C++ How to program. I am running into some early errors in trying to incorporate the Date class into ...
  • Java - Quadrilateral, etc. - Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Make the hierarchy as deep (i.e., as man ...
  • Classes in C++, implementing a member function. - I am having a dificult time understanding Classes in C++ and how to implement member functions. Given the attached code I need to: 1: Add the code to implement all of the member functions. 2: Test ...
  • Using constructor to create Rectangle and PlaneRectangle classes - The Class for a Rectangle is shown below. PlaneRectangle is a specialisation of Rectangle with fields that define the location of the centre of the rectangle. Write Java Classes that are implementatio ...
Browse