Implement the destructors and constructors


Discuss the following:

Q: 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 Preview :

Prepared by a verified Expert
C/C++ Programming: Implement the destructors and constructors
Reference No:- TGS01937814

Now Priced at $25 (50% Discount)

Recommended (92%)

Rated (4.4/5)