Question
(Do not write new code, just fix the code below the question.. my prof. will not accept new code.. make it work in c++ program
(Do not write new code, just fix the code below the question.. my prof. will not accept new code.. make it work in c++ program )
-------------------------------------------------------------
#include
//start main function
int main()
{
double CommissionAmount = 0;
double AmountofSales = 1;
double CommissionAmountSought = 30000;
// do while loop is used as asked in the question
do
{
//CommissionAmount is computed as given in the question
// If the sales amount is greater than 10000
if (AmountofSales >= 10001)
CommissionAmount = 5000 * 0.08 + 5000 * 0.1 +(AmountofSales - 10000) * 0.12;
// If the sales amount is less than 10000 but greater
//than 5000
else if (AmountofSales >= 5001)
CommissionAmount = 5000 * 0.08 + (AmountofSales - 5000)* 0.10;
// If the sales amount is less than 5000
else
CommissionAmount = AmountofSales * 0.08;
AmountofSales++;
}
//The following code line is used for comparison between //CommissionAmount and CommissionAmountSought.
while (CommissionAmount);
// Display the sales amount
cout
return 0;
}
(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 110% $10,000.01 and above 12% Note that this is a graduated rate. The rate for the first $5000 is at 896, 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% + 1 5000 * 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
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started