I was able to write a program to compute sales commission. Itread a sales amount
ID: 3613960 • Letter: I
Question
I was able to write a program to compute sales commission. Itread a sales amount from the keyboard then displayed the totalcommision (not the rate) by using the following table. $1-$5000 = 8% $5001-$10000 = 10% $10001 and above = 12% sample run: Enter the sales amount: $2502.32 Thetotal commission is: $200.186public class Commission {
public static void main(String [] args) {
double salesAmount;
double commissionAmount;
double displayCommissionAmount;
System.out.print("Enter the sales amount:");
salesAmount = Keyboard.readDouble( );
if (salesAmount<= 5000) {
commissionAmount = 0.08 * salesAmount;
} else if ((salesAmount> 5001) &&(salesAmount<=10000)) {
commissionAmount = 0.10 * salesAmount;
} else {
commissionAmount = 0.12 * salesAmount;
}
System.out.print("The total commission is ");
System.out.println(commissionAmount); HOWEVER, now I need to write a program to compute how muchsales a salesperson must generate in order to earn a specificcommission. It must read the 'target' commssion amount It must print the smallest amount of sales that would have tobe generated in order to earn an amount that is at least as largeas the targeted commission amount. Use the same commission rate table given above. sample run: Enter the target commission: $200.20 Thesales target is $2502.50 I can't figure out how to write this one...If I want to earn$200.20 today, how much sales do I have to generate? What is themath behind it? I was able to write a program to compute sales commission. Itread a sales amount from the keyboard then displayed the totalcommision (not the rate) by using the following table. $1-$5000 = 8% $5001-$10000 = 10% $10001 and above = 12% sample run: Enter the sales amount: $2502.32 Thetotal commission is: $200.186
public class Commission {
public static void main(String [] args) {
double salesAmount;
double commissionAmount;
double displayCommissionAmount;
System.out.print("Enter the sales amount:");
salesAmount = Keyboard.readDouble( );
if (salesAmount<= 5000) {
commissionAmount = 0.08 * salesAmount;
} else if ((salesAmount> 5001) &&(salesAmount<=10000)) {
commissionAmount = 0.10 * salesAmount;
} else {
commissionAmount = 0.12 * salesAmount;
}
System.out.print("The total commission is ");
System.out.println(commissionAmount); HOWEVER, now I need to write a program to compute how muchsales a salesperson must generate in order to earn a specificcommission. It must read the 'target' commssion amount It must print the smallest amount of sales that would have tobe generated in order to earn an amount that is at least as largeas the targeted commission amount. Use the same commission rate table given above. sample run: Enter the target commission: $200.20 Thesales target is $2502.50 I can't figure out how to write this one...If I want to earn$200.20 today, how much sales do I have to generate? What is themath behind it?
Explanation / Answer
Oh ok. Than what you can do is turn the logic that was done toobtain the values 400 and 1000 inside the actual code therefore what you end up with if (targetCommissionRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.