package com.java.week01;
import java.util.Scanner;
/**
*
* @author Alfred
* @data 2018年7月21日下午6:20:33
* Description:题目:企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可可提成7.5%;20万到40万之间时,高于20万元的部分,可提成5%;40万到60万之间时高于40万元的部分,可提成3%;60万到100万之间时,高于60万元的部分,可提成1.5%,高于100万元时,超过100万元的部分按1%提成,从键盘输入当月利润I,求应发放奖金总数?
* Version:1.0
*/
public class Demo03 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
System.out.print("请输入您的利润(¥):");
double profit = sc.nextDouble();
double premium = 0;
if (profit > 100000) {
if (profit > 200000) {
if (profit > 400000) {
if (profit > 600000) {
if (profit > 1000000) {
premium = (profit - 1000000) * 0.01 + 39500;
} else {
premium = (profit - 600000) * 0.015 + 33500;
}
} else {
premium = (profit - 400000) * 0.03 + 27500;
}
} else {
premium = (profit - 200000) * 0.05 + 17500;
}
} else {
premium = (profit - 100000) * 0.075 + 10000;
}
} else {
premium = profit * 0.1;
}
System.out.println("您的奖金为:" + premium + "¥");
}
}