Question

Create a C++ console application to calculate the salary of employees for a used car dealership....

Create a C++ console application to calculate the salary of employees for a used car dealership. Salary structure is based on draw against commission. The salespeople receive a commission based on their sales. However, they are guaranteed a minimum salary (draw). If the commission is more than this amount, they receive the commission, otherwise, they receive the draw. Calculate sales commission as follows:

Below $10,000 sales: No commission
From $10,000 up to $50,000: 1% commission
From $50,000 up to $100,000: 2% commission
From $100,000 up to $200,000: 3% commission
$200,000 and over: 4% commission
In addition, any salesperson who sells $250,000 or more will receive an extra $500 bonus for becoming a member of the $250,000 Club.

Ask the user for the draw and sales amount. Do not accept negative numbers. If any of the values is negative, display an error message, and ask the user one more time to enter the value. Assume the second time the value is correct. Write an algorithm to calculate the salary and display it. If the salesperson is a member of the $250,000 Club, display a $250,000 CLUB MEMBER message.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

//C++ code

#include<iostream>
#include<iomanip>
using namespace std;

int main()
{
   //For upto two decimal
   cout << fixed << setprecision(2);
   /*
   In addition, any salesperson who sells $250,000 or
   more will receive an extra $500
   bonus for becoming a member of the $250,000 Club.
   */
   const double BONUS = 500;
   double draw, sales;
   double commission = 0;
   cout << "Enter draw (Salary): ";
   cin >> draw;
   while (draw < 0)
   {
       cout << "ERROR.. invalid value!" << endl;
       cout << "Enter draw (Salary): ";
       cin >> draw;
   }
   cout << "Enter sales: ";
   cin >> sales;
   while (sales < 0)
   {
       cout << "ERROR.. invalid value!" << endl;
       cout << "Enter sales: ";
       cin >> sales;
   }
   /*
   Calculate sales commission as follows:

Below $10,000 sales: No commission
From $10,000 up to $50,000: 1% commission
From $50,000 up to $100,000: 2% commission
From $100,000 up to $200,000: 3% commission
$200,000 and over: 4% commission
   */
   if (sales < 10000)
       commission = 0;
   else if (sales >= 10000 && sales < 50000)
       commission = sales * 0.01; //1%
   else if (sales >= 50000 && sales < 100000)
       commission = sales * 0.02; //2%
   else if (sales >= 100000 && sales < 200000)
       commission = sales * 0.03; //3%
   else
       commission = sales * 0.04;//4%
   /*
   any salesperson who sells $250,000 or more
   will receive an extra
   $500 bonus for becoming a member of the $250,000 Club.
   */
   bool isMember = false;
   if (sales >= 250000)
   {
       isMember = true;
       cout << "$250,000 CLUB MEMBER" << endl;
   }
   /*
   If the commission is more than this amount,
   they receive the commission, otherwise,
   they receive the draw.
   */
   if (commission > draw)
   {
       if (isMember)
       {
           draw = draw + BONUS;
       }
       cout << "You recieve: $" << draw << endl;
   }
   //If the commission is 0 will gets fixed salary
   else if (commission == 0)
   {
       cout << "You recieve: $" << draw << endl;
   }
   //Otherwise commision <draw
   else
   {
       if (isMember)
       {
           commission = commission + BONUS;
       }
       cout << "You recieve: $" << commission << endl;
   }
   cout << "Thanks... Have a nice day.." << endl;
   //pause
   system("pause");
}

//Output

//If you need any help regarding this solution ........ please leave a comment ...... thanks

Add a comment
Know the answer?
Add Answer to:
Create a C++ console application to calculate the salary of employees for a used car dealership....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ console application that uses functions to calculate an employee’s salary.

    Write a C++ console application that uses functions to calculate an employee’s salary.PART 1: Create a void function to print a menu asking the user to choose from the following options:1 - Annual salary2 - Monthly salary3 - Daily rate of pay4 – ExitThe void function only prints the menu. Format your cout statement to include the menu as displayed above.If the chosen option is 1- Annual Salary, ask the user for the number of hours they work perweek and...

  • Objectives – to practice these new concepts: decision-making with if, if-else, if-else-if-… switch data validation for...

    Objectives – to practice these new concepts: decision-making with if, if-else, if-else-if-… switch data validation for user input using a while (or while/do) loop nicely formatted output report with printf and format strings multiple input data sets using a while (or while/do) loop named constants PROJECT OVERVIEW This project provides a detailed payroll report for the sales staff at TheLaptopShop. The company has 3 tiers of salespeople: low, middle, high (designated by L, M, H) – based on their past...

  • Read the Article posted below, then answer the following questions: 1. As a junior member of...

    Read the Article posted below, then answer the following questions: 1. As a junior member of your company’s committee to explore new markets, you have received a memo from the chairperson telling you to be prepared at the next meeting to discuss key questions that need to be addressed if the company decides to look further into the possibility of marketing to the BOP segment. The ultimate goal of this meeting will be to establish a set of general guidelines...

  • Budgeting for an Academic Department at a State University: Can You Believe the Numbers? INTRODUCTION You...

    Budgeting for an Academic Department at a State University: Can You Believe the Numbers? INTRODUCTION You are the senior accounting faculty member in the business school and your dean, Dean Weller, is asking for help. She is very discouraged after a midyear budget meeting with the Vice President of Finance. The college's Department of Social Work has a large budget deficit, and because of this the VP is inclined towards closing the department entirely or closing its bachelor's program. The...

  • this is all the information given Personal Financial Planning Mini-Case Jeff and Mary Douglas, a couple...

    this is all the information given Personal Financial Planning Mini-Case Jeff and Mary Douglas, a couple in their mid-30s, have two children - Paul age 6 and Marcy age 7. The Douglas' do not have substantial assets and have not yet reached their peak earning years. Jeff is a general manager of a jewelry manufacturer in Providence, RI while Mary teaches at the local elementary school in the town of Tiverton, RI. The family needs both incomes to meet their...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT