I am using Python. Hal owns a business named Make Your Own Music, which sells guitars, drums, banjos, synthesizers, and many other musical instruments. Hal’s sales staff works strictly on commission. At the end of the month, each salesperson’s commission is calculated according to Table 1. Table 1 – Sales Commission Rates Sales This Month Commission Rate Less than $10,000.00 10% $10,000.00—14,999.99 12% $15,000.00—17,999.99 14% $18,000.00—21,999.99 16% $22,000 or more 18% For example, a salesperson with $16,000 in monthly sales will earn a 14 percent commission ($2,240). Another salesperson with $20,000 in monthly sales will earn a 16 percent commission ($3,200). A person with $30,000 in monthly sales will earn an 18 percent commission ($5,400). Because the staff gets paid once per month, Hal allows each employee to take up to $2,000 per month in advance. When sales commissions are calculated, the amount of each employee’s advanced pay is subtracted from the commission. If any salesperson’s commission is less than the amount of his or her advance, the salesperson must reimburse Hal for the difference. To calculate a salesperson’s monthly pay, Hal uses the following formula: Pay = Sales × Commission rate – Advanced pay Hal has asked you to write a program that makes this calculation for him. The following general algorithm outlines the steps the program must take: 1. Get the salesperson’s monthly sales. 2. Get the amount of advanced pay. 3. Use the amount of monthly sales to determine the commission rate. 4. Calculate the salesperson’s pay using above formula. If the amount is negative, indicate that the salesperson must reimburse the company. Note rather than presenting the entire program at once, your program must utilize functions (see below functions headings) to breakdown the entire problem into subproblems. Program Sample Run #1 (with Input Shown in Bold) Enter the salesperson’s monthly sales. 14650.00 Enter the amount of advanced pay, or 0 if no advanced pay was given. 1000.00 The pay is $758.00 Program Sample Run #2 (with Input Shown in Bold) Enter the salesperson’s monthly sales. 9000.00 Enter the amount of advanced pay, or 0 if no advanced pay was given. 0 The pay is $900.00 Program Sample Run #3 (with Input Shown in Bold) Enter the salesperson’s monthly sales. 12000.00 Enter the amount of advanced pay, or 0 if no advanced pay was given. 2000.00 The pay is $-560.00 The salesperson must reimburse the company.
I am using Python.
Hal owns a business named Make Your Own Music, which sells guitars, drums, banjos, synthesizers, and many other musical instruments. Hal’s sales staff works strictly on commission. At the end of the month, each salesperson’s commission is calculated according to Table 1.
Table 1 – Sales Commission Rates
Sales This Month Commission Rate
Less than $10,000.00 10%
$10,000.00—14,999.99 12%
$15,000.00—17,999.99 14%
$18,000.00—21,999.99 16%
$22,000 or more 18%
For example, a salesperson with $16,000 in monthly sales will earn a 14 percent commission ($2,240). Another salesperson with $20,000 in monthly sales will earn a 16 percent commission ($3,200). A person with $30,000 in monthly sales will earn an 18 percent commission ($5,400).
Because the staff gets paid once per month, Hal allows each employee to take up to $2,000 per month in advance. When sales commissions are calculated, the amount of each employee’s advanced pay is subtracted from the commission. If any salesperson’s commission is less than the amount of his or her advance, the salesperson must reimburse Hal for the difference. To calculate a salesperson’s monthly
pay, Hal uses the following formula:
Pay = Sales × Commission rate – Advanced pay
Hal has asked you to write a program that makes this calculation for him. The following general
1. Get the salesperson’s monthly sales.
2. Get the amount of advanced pay.
3. Use the amount of monthly sales to determine the commission rate.
4. Calculate the salesperson’s pay using above formula. If the amount is negative, indicate that the salesperson must reimburse the company.
Note rather than presenting the entire program at once, your program must utilize functions (see below functions headings) to breakdown the entire problem into subproblems.
Program Sample Run #1 (with Input Shown in Bold)
Enter the salesperson’s monthly sales.
14650.00
Enter the amount of advanced pay, or 0 if no advanced pay was given.
1000.00
The pay is $758.00
Program Sample Run #2 (with Input Shown in Bold)
Enter the salesperson’s monthly sales.
9000.00
Enter the amount of advanced pay, or 0 if no advanced pay was given.
0
The pay is $900.00
Program Sample Run #3 (with Input Shown in Bold)
Enter the salesperson’s monthly sales.
12000.00
Enter the amount of advanced pay, or 0 if no advanced pay was given.
2000.00
The pay is $-560.00
The salesperson must reimburse the company.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images