当前位置 : 主页 > 编程语言 > java >

佣金问题

来源:互联网 收集:自由互联 发布时间:2021-06-28
gistfile1.txt package com.wellbo.test;import java.util.*;public class Commission {public static void main(String[] args){double sum1,sum2;System.out.println("请输入枪机、枪托、枪管的数量");Scanner input = new Scanner(System.in
gistfile1.txt
package com.wellbo.test;
import java.util.*;


public class Commission {
	public static void main(String[] args){
		double sum1,sum2;
		System.out.println("请输入枪机、枪托、枪管的数量");
		Scanner input = new Scanner(System.in);
		try{
		double a1 = input.nextDouble();
		double b1 = input.nextDouble();
		double c1 = input.nextDouble();
		if((a1<1)||(a1>70)||(b1<1)||(b1>80)||(c1<1)||(c1>70))
		{
			System.out.println("您的输入有误!");
		}
		else{
			sum1 = a1*45+b1+30+c1*25;
			if(sum1<=1000)
			{
				sum2 = sum1*0.1;
				System.out.println("总销售额为:"+sum1);
				System.out.println("佣金为:"+sum2);
			}else if((sum1>1000)&&(sum1<=1800))
					{
						sum2 = (sum1-1000)*0.15+1000*0.1;
						System.out.println("总销售额为:"+sum1);
						System.out.println("佣金为:"+sum2);	
					}else if(sum1>1800)
					{
						sum2 = 1000*0.1+800*0.15+(sum1-1800)*0.2;
						System.out.println("总销售额为:"+sum1);
						System.out.println("佣金为:"+sum2);
					}			
		}
		}finally{
			input.close();
		}
	}
}
上一篇:java 输出js 脚本
下一篇:2017 12 6
网友评论