Purchase Solution

Class named RealtorCommission

Not what you're looking for?

Ask Custom Question

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.

Purchase this Solution

Solution Summary

Create a class named RealtorCommission.

Solution Preview

I have also attached the code and executable. Please read the comments. The destructor will not do anything in particular here because the variables are not accessing dynamic memory.
hope it helps.

#include <iostream>
using namespace std;

class RealtorCommission{
//Fields
public:
double salesPrice, salesCommRate, commission;

RealtorCommission(double salesPrice, double ...

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.