作业内容
(1)已知某公司员工的保底薪水为3000,某月所接工程的利润profit(整数)与利润提成的关系如下所示(计量单位:元)。计算员工的当月薪水。
工程利润profit 提成比率
profit≤1000 没有提成
1000<profit≤2000 提成10%
2000<profit≤5000 提成15%
5000<profit≤10000 提成20%
10000<profit 提成25%
public class banyan1_1{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a=3000;
System.out.println(" 输入利润: ");
int pr=sc.nextInt();
if (pr<=1000) {
System.out.println("没有提成");
} else if(pr>1000&&pr<=2000) {
double xs=a+pr*0.1;
System.out.println("员工的月薪水: "+ String.format("%.2f",xs ) );
} else if(pr>2000&&pr<=5000) {
double xs=a+pr*0.15;
System.out.println("员工的月薪水: "+ String.format("%.2f",xs ) );
} else if(pr>5000&&pr<=10000) {
double xs=a+pr*0.2;
System.out.println("员工的月薪水: "+ String.format("%.2f",xs ) );
} else {
double xs=a+pr*0.25;
System.out.println("员工的月薪水: "+ String.format("%.2f",xs ) );
}
}
}



