Write a java program that finds out the minimum amount of sales I have to genera
ID: 3640791 • Letter: W
Question
Write a java program that finds out the minimum amount of sales I have to generate in order to make $30,000. The base salary is $5,000. Here is the commission rate:$0.01 - $5,000 = 8 percent
$5,000.01 - $10,000 = 10 percent
$10,000.01 - and above = 12 percent
Thanks!
Explanation / Answer
package mundo; //Write a java program that finds out the minimum amount of sales I have to generate in order to make $30,000. The base salary is $5,000. Here is the commission rate: //$0.01 - $5,000 = 8 percent //$5,000.01 - $10,000 = 10 percent //$10,000.01 - and above = 12 percent public class Salari { public final static double BASE = 5000; public final static double FIRSTCOMISSION = 8; public final static double SECONDCOMISSION = 10; public final static double THIRDCOMISSION = 0.12; private double sales; private double moneyEarned; public Salari() { moneyEarned = BASE; } public void sale(double amountOftheSale) { if(amountOftheSale >= 0.01 && amountOftheSale = 5000.01 && amountOftheSale = 10000.01) { sales +=amountOftheSale; moneyEarned += moneyEarned * THIRDCOMISSION; } } public double getAmountOfSales() { return sales; } public double getAmountOfMoneyEarned() { return moneyEarned; } }Related 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.