Question

In: Computer Science

Write a program that can be used to calculate the commission earned in a real estate...

Write a program that can be used to calculate the commission earned in a real estate transaction. The chart below describes the formulas used to calculate the commission. Your program will ask the user for the sales price as an double, calculate the commission, and display the sales price and commission. Remember to use constants rather than “magic numbers”.

Sales Price Commission Less than $100,000 5% of the sales price $100,000 to $300,000 $5,000 + 10% of the amount of the sales price over $100,000 More than $300,000 $25,000 + 15% of the amount of the sales price over $300,000


2. Write a program that acts as a simple calculator. You will ask the user to enter two integers. Then you will ask for an operator from the list *,/,%,+, and -. If the user does not enter a valid operator, you will report the error and not perform any action. If the user asked to do division and the second number is zero, you will report the error and not perform any action. Otherwise, you will display what the equation is and the result

Solutions

Expert Solution

1: C++:

#include <iostream>

using namespace std;

int main() {

double sale,commision;

cout<<"Enter sale Amount: $";

cin>>sale;

if(sale<100000){

commision=0.05*sale;

}

else if(sale>=100000 && sale<300000){

commision=5000+((sale-100000)*0.10);

}

else{

commision=25000+((sale-300000)*0.15);

}

cout<<"Sale Amount= $"<<sale<<endl;

cout<<"Commision=: $"<<commision;

}



2)

#include <iostream>

using namespace std;

int main() {

int a,b;

char ch;

cout<<"Enter integer 1: ";

cin>>a;

cout<<"Enter integer 2: ";

cin>>b;

cout<<"Enter one out of following: +,-,*,/,% ";

cin>>ch;

if(ch=='+')

cout<<"The result of "<<a<<"+"<<b<<" is "<<(a+b);

else if(ch=='-'){

cout<<"The result of "<<a<<"-"<<b<<" is "<<(a-b);

}

else if(ch=='*'){

cout<<"The result of "<<a<<"*"<<b<<" is "<<(a*b);

}

else if(ch=='/'){

if(b==0){cout<<"Error, Cannot divide with 0"; }

else{

cout<<"The result of "<<a<<"/"<<b<<" is "<<(double)(a/b);}

}

else if(ch=='%'){

cout<<"The result of "<<a<<"%"<<b<<" is "<<(a%b);

}

else

cout<<"Invalid input";

}

if you like the answer please provide a thumbs up.


Related Solutions

Write a program that can be used to calculate the federal tax. The tax is calculated...
Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and $40,000, the tax is $2,250...
C++ Write a program that can be used to calculate the federal tax. The tax is...
C++ Write a program that can be used to calculate the federal tax. The tax is calculated as follows: for single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. the tax rates are as follows: if the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and 40,000 the tax rate...
Assume you negotiated the sale as a real estate broker and are entitled to a six percent commission.
Assume you negotiated the sale as a real estate broker and are entitled to a six percent commission. The offer and acceptance contract calls for a sales price of $230,000. The buyer has tendered $2,000 for earnest money. The buyer has received loan approval on an 80% loan to value ratio loan. The property is presently encumbered with an existing mortgage with a balance of $150,691.73. The interest on the loan has been paid through April 30, 2019. The interest...
how is kurtosis used in real estate investments?
how is kurtosis used in real estate investments?
how is kurtosis used in real estate investments ?
how is kurtosis used in real estate investments ?
. A process description for “Pay Commission" is provided below:            For each COMMISSION EARNED           ...
. A process description for “Pay Commission" is provided below:            For each COMMISSION EARNED                         If EXTRA BONUS equals Y                                   If PAYMENT TOTAL is greater than $80,000                                                 Add 3% to COMMISSION PERCENT                                                 Output SPECIAL LETTER                                                 Output AWARD LIST                                            Else   Add 2% to COMMISSION PERCENT                                                   Output AWARD LIST                 Else                                     If PAYMENT TOTAL is greater than $80,000 Add 1% to COMMISSION PERCENT                                                 Output SPECIAL LETTER...
81. “Let’s not do business with AVC Real Estate Company; they discount their commission” is an example of what?
  81. “Let’s not do business with AVC Real Estate Company; they discount their commission” is an example of what? Price fixing Boycott Market allocation Tying agreement 82. What is another name for a like-kind exchange? Section 1231 exchange Tax-free exchange Section 1031 exchange Business property exchange 83. Why are UST’s a possible environmental threat? They release toxic fumes into the air They are illegal They are not regulated in NY The contents can leak into the soil 84. Which...
Calculate Lopez’s cost recovery deduction for 2019 if the building is: a. Classified as residential rental real estate. b. Classified as nonresidential real estate.
Lopez acquired a building on June 1, 2014, for $1 million. Calculate Lopez’s cost recovery deduction for 2019 if the building is: a. Classified as residential rental real estate. b. Classified as nonresidential real estate.
Write a program that can calculate the amount of federal tax aperson owes for the...
Write a program that can calculate the amount of federal tax a person owes for the upcoming year.After calculating the amount of tax owed, you should report to the user their filing status (single/joint), which tax rate they fell under, as well as the tax owed. Example: “As a single filer you fell under 12% tax bracket and you owe $3500.”Disclaimer: This example is simplified and is not intended to be an accurate representation of how to calculate your taxes.Your...
in c++ Write a program that can calculate the arithmetic mean, the geometric mean, and the...
in c++ Write a program that can calculate the arithmetic mean, the geometric mean, and the harmonic mean of a set of five numbers. •The program should ask the user to enter fiver numbers, calculate the means, and print all the data to a text file. The program should output the expected results.•Example: The text file should read: For the set of numbers {1,2,3}. The arithmetic mean is 2, the geometric mean is about 1.82, and the harmonic mean is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT