I am trying to figure out how to run programs and compile them in C++ if anyone can help please let me know. The major problem I am having is on this particular problem Prb04-3.cpp it will not let me run it. I tried to paste it on here and wont do it for some reason.
All of the problems with the code you posted are due to carelessness -- misspelled words. When programming you have to learn to pay attention to small details, such as capitalization and spelling. Look at your compilers error messages and fix the problems one at a time. Normally the first error message is the most important. Fix it then recompile to see what's left.
Here is the program with all those errors corrected. I didn't run the program so I don't know if it works correctly or not.
// This program determines the commission on real estate sales
// depending on the type of property sold.
using namespace std;
int main ()
const double RESIDENTIAL_RATE = 0.060;
const double MULTIDWELLING_RATE = 0.050;
const double COMMERCIAL_RATE = 0.045;
cout << setprecision (2)
<< setiosflags (ios::fixed)
<< setiosflags (ios::showpoint) ;
cout << "Enter the property's selling price: ";
cin >> sale_price;
cout << endl ;
cout << "Enter the property code according to the following."
<< endl << endl ;
cout << "Residental, enter R" << endl;
cout << "Multiple Dwelling, enter M" << endl;
cout << "Commercial, enter C" << endl << endl;
cout << "Please make your selection: :";
cin. get () ; // Discard the \n
property_code = cin.get () ;
if( property_code == 'R' || property_code == 'r')
commission_rate = RESIDENTIAL_RATE;
else if( property_code == 'M' || property_code == 'm')
commission_rate = COMMERCIAL_RATE;
cout << endl << endl
<<"Invalid Property Code! Try Again" << endl;
commission = sale_price * commission_rate;
cout << endl << endl;
cout << "The commsiion is " << commission << endl;