Problem

(Financial application: find the sales amount) Rewrite Programming Exerciseusing the binar...

(Financial application: find the sales amount) Rewrite Programming Exercise

using the binary search approach. Since the sales amount is between 1 and COMMISSION_SOUGHT/0.08 , you can use a binary search to improve the solution.

Programming Exercise (Financial application: find the sales amount) You have just started a sales job in a department store. Your pay consists of a base salary and a commission. The base salary is $5,000. The scheme shown below is used to determine the commission rate:

Sales Amount

Commission Rate

$0.01-$5,000

8%

$5,000.01-$10,000

10%

$10,000.01 and above

12%

Note that this is a graduated rate. The rate for the first $5000 is at 8%, the next $5000 is at 10%, and the rest is at 12%. If the sales amount is 25000, the commission is 5000*8% + 5000 * 10% + 15000 * 12% = 2700.

Your goal is to earn $30,000 a year. Write a program that uses a do-while loop to find out the minimum number of sales you have to generate in order to make $30,000.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
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