Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A company pays its salespeople on a commission basis. the salespeople each recei

ID: 3826941 • Letter: A

Question

A company pays its salespeople on a commission basis. the salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9 percent of$5000, or a total of $650. Write a program (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount): $200-299 $300-399 $400-499 $500-599 $600-699 $700-799 $800-899 $900-999 $1000 and over.

Explanation / Answer

Note: Not done using arrays...

#include <iostream>
#include <iomanip> // To set precision
using std::cin;
using std::cout;
using std::endl;
using std::setprecision;

int main ()
{
   float commission;
   float salary;
   int grossSales;
   int salesPeople;
   int count1 = 0;
   int count2 = 0;
   int count3 = 0;
   int count4 = 0;
   int count5 = 0;
   int count6 = 0;
   int count7 = 0;
   int count8 = 0;
   int count9 = 0;
  
   cout << "The salesPeople receive $200 plus 9 percent of their gross sales that week." << endl;
   cout << "Enter the number of sales people." << endl;
   cin >> salesPeople;

   cout << "Enter the salespersons gross sales in GBP $ " << endl;
   cin >> grossSales;
   commission = 0.09 * grossSales; // commission rate
   salary = commission + 200.0;
   if ( commission <= 299 )
   count1++;
   else if ( 300 <= commission <= 399 )
   count2++;
   else if ( 400 <= commission <= 499 )
   count3++;
   else if ( 500 <= commission <= 599 )
   count4++;
   else if ( 600 <= commission <= 699 )
   count5++;
   else if ( 700 <= commission <= 799 )
   count6++;
   else if ( 800 <= commission <= 899 )
   count7++;
   else if ( 900 <= commission <= 999 )
   count8++;
   else if ( 1000 <= commission )
   count9++;
   cout << "Employee's commission is $" << setprecision (2) << commission << endl;
   cout << "Employee's salary is $" << setprecision (2) << salary << endl;

   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote