Question

In: Computer Science

A company pays its five salespeople on a commission basis. The salespeople receive $200 plus 10%...

A company pays its five salespeople on a commission basis. The salespeople receive $200 plus 10% of their sale. For example, for the employee sale of $1000, the commission is $300.

Write a C program that:

  • inputs each employee sales.
  • The program then calculates the employee commission, prints out each employee commission.
  • The program calculates the total sum of all commissions paid, and print.
  • Your program will use a sentinel value to exit.
  • You must use a one-dimensional array for the sales people commissions.

Solutions

Expert Solution

Program Code Screenshot

Program Sample Input/Output Screenshot

Program Code to Copy

#include <stdlib.h>
#include <stdio.h>

int main(void)
{
    // a one-dimensional array for the sales people commissions
    float commissions[1000];
    int k = 0;
    // use sentinel loop
    while (1)
    {
        printf("Enter Sales value (-1 to stop): ");
        float val;
        scanf("%f", &val);
        if (val == -1)
        {
            break;
        }
        //  calculates each employee commission
        commissions[k++] = 200 + (val * 0.1);
    }
    // prints out each employee commission
    printf("Each Employee Commission...\n");
    for (int i = 0; i < k; i++)
    {
        printf("Employee %d: $%0.2f\n", i + 1, commissions[i]);
    }

    // calculate the total sum of all commissions paid, and print
    float total_sum = 0;
    for (int i = 0; i < k; i++)
    {
        total_sum += commissions[i];
    }
    printf("Total Commissions Paid = $%0.2f", total_sum);
}

Related Solutions

A company pays its salespeople on a commission basis. The salespeople are paid $200 per week...
A company pays its salespeople on a commission basis. The salespeople are paid $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of merchandise in a week is paid $200 plus 9% of $5000, for a weekly pay of $650. Create an application that uses a for loop to input each sales person’s gross sales for the week, and calculates and displays that sales person’s weekly pay. Process one...
A company pays its salespeople on a commission basis. The salespeople each receive $250 per week...
A company pays its salespeople on a commission basis. The salespeople each receive $250 per week plus 11 percent of their gross sales for the sales period. For example, a salesperson who grosses $5000 in sales in the period receives $250 plus 11 percent of $5000, or a total of $812.21. Write a program (using an array of counters) determines for each salesperson their total sales, their salary and additional data points. There are 12 salesmen for the company. The...
C++ Program A company pays its salespeople on a commission basis.  The salespeople each receive $250 per...
C++ Program A company pays its salespeople on a commission basis.  The salespeople each receive $250 per week plus 11 percent of their gross sales for the sales period.  For example, a salesperson who grosses $5000 in sales in the period receives $250 plus 11 percent of $5000, or a total of $812.21.  Write a program (using an array of counters) determines for each salesperson their total sales, their salary and additional data points.  There are 12 salesmen for the company.  The input data file...
First The sales department of a cellular phone company pays its salespeople $1,500 per month plus...
First The sales department of a cellular phone company pays its salespeople $1,500 per month plus 25 percent of each new subscriber’s first month’s billings. A new subscriber’s first-month bill averages $80. Salespeople work 160 hours a month (four weeks at 40 hours per week). If salespeople work more than 160 hours per month, they receive $12 per hour for hours in excess of 160. Sales leads for the sales department are generated in a variety of ways—direct mailings to...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently,...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently, each of its five salespeople earns a 6% commission on the units they sell for $100 each, plus a fixed salary of $41,200 per person. Glade hopes that by increasing commissions to 11% and decreasing each salesperson’s salary to $21,200, sales will increase because salespeople will be more motivated. Currently, sales are 20,000 units. Glade’s other fixed costs, NOT including the salespeople’s salaries, total...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently,...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently, each of its five salespeople earns a 9% commission on the units they sell for $100 each, plus a fixed salary of $40,200 per person. Glade hopes that by increasing commissions to 14% and decreasing each salesperson’s salary to $21,100, sales will increase because salespeople will be more motivated. Currently, sales are 20,000 units. Glade’s other fixed costs, NOT including the salespeople’s salaries, total...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently,...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently, each of its five salespeople earns a 12% commission on the units they sell for $100 each, plus a fixed salary of $41,900 per person. Glade hopes that by increasing commissions to 17% and decreasing each salesperson’s salary to $21,600, sales will increase because salespeople will be more motivated. Currently, sales are 20,000 units. Glade’s other fixed costs, NOT including the salespeople’s salaries, total...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently,...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently, each of its five salespeople earns a 7% commission on the units they sell for $100 each, plus a fixed salary of $40,100 per person. Glade hopes that by increasing commissions to 12% and decreasing each salesperson’s salary to $21,500, sales will increase because salespeople will be more motivated. Currently, sales are 17,000 units. Glade’s other fixed costs, NOT including the salespeople’s salaries, total...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently,...
Glade, Inc. is trying to decide whether to increase the commission-based pay of its salespeople. Currently, each of its five salespeople earns a 12% commission on the units they sell for $100 each, plus a fixed salary of $41,100 per person. Glade hopes that by increasing commissions to 17% and decreasing each salesperson’s salary to $21,700, sales will increase because salespeople will be more motivated. Currently, sales are 17,000 units. Glade’s other fixed costs, NOT including the salespeople’s salaries, total...
C++ Program (Using 2D array and bubble sort to sort data) A company pays its salespeople...
C++ Program (Using 2D array and bubble sort to sort data) A company pays its salespeople on a commission basis.  The salespeople each receive $250 per week plus 11 percent of their gross sales for the sales period.  For example, a salesperson who grosses $5000 in sales in the period receives $250 plus 11 percent of $5000, or a total of $812.21.  Write a program (using an array of counters) determines for each salesperson their total sales, their salary and additional data points.  There...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT