admin管理员组文章数量:1558099
第五章第三十九题(金融应用:求销售总额)(Financial application: find the sales amount)
- *5.39(金融应用:求销售总额)假设你正在某百货商店开始销售工作。你的工资包括基本工资和提成。基本工资是5000美元。使用下面的方案确定你的提成率。
你的目标是一年挣30000美元。编写程序找出为挣到30000美元,你所必须完成的最小销售额。
销售额 | 提成率 |
---|---|
0.01~5000美元 | 8% |
5000.01~10000美元 | 10% |
10000.01美元及以上 | 12% |
*5.39 (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.
Your goal is to earn $30,000 a year. Write a program to find the minimum sales you have to generate in order to make $30,000.
Sales Amount | Commission Rate |
---|---|
$0.01~$5000 | 8% |
$5000.01~10000 | 10% |
$10000.01and above | 12% |
- 参考代码:
package chapter05;
public class Code_39 {
public static void main(String[] args) {
final int BASE_SALARY = 5000;
int salesAmount = 10000;
double mySalary = 0;
do {
mySalary = BASE_SALARY + 5000 * 0.08 + 5000 * 0.10 + (salesAmount-10000) * 0.12;
salesAmount++;
} while (mySalary < 30000);
System.out.printf("The minimum sales you have to generate is %d", salesAmount);
}
}
- 结果显示:
The minimum sales you have to generate is 210835
Process finished with exit code 0
版权声明:本文标题:第五章第三十九题(金融应用:求销售总额)(Financial application: find the sales amount) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1727384107a1112220.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论