第五章第三十九题(金融应用:求销售总额)(Financial application: find t - 新闻资讯 - 云南小程序开发|云南软件开发|云南网站建设-昆明葵宇信息科技有限公司

159-8711-8523

云南网建设/小程序开发/软件开发

知识

不管是网站,软件还是小程序,都要直接或间接能为您产生价值,我们在追求其视觉表现的同时,更侧重于功能的便捷,营销的便利,运营的高效,让网站成为营销工具,让软件能切实提升企业内部管理水平和效率。优秀的程序为后期升级提供便捷的支持!

您当前位置>首页 » 新闻资讯 » 技术分享 >

第五章第三十九题(金融应用:求销售总额)(Financial application: find t

发表时间:2020-10-19

发布人:葵宇科技

浏览次数:66

第五章第三十九题(金融应用:求销售总额)(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 AmountCommission Rate$0.01~$50008%$5000.01~1000010%$10000.01and above12%
  • 参考代码:
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

相关案例查看更多