import java.util.Scanner; public class Method { public static int late(int lateminute,double gongzi){ int fakuan =0;//罚款 if(lateminute<11){ System.out.println("警告!!不能迟到!"); }else if(lateminute<21){ fakuan=100; }else if (lateminute<31){ fakuan=200; }else if (lateminute<61){ fakuan =(int)(gongzi/(21.75*2));//半日工资,21.75指月平均工作日 }else { fakuan =(int)(gongzi*3/(21.75)); } System.out.println("迟到时间"+lateminute+"罚款:"+fakuan); return fakuan; } public static void main(String[] args) { Scanner scanner =new Scanner(System.in); System.out.println("输入迟到时间(分钟)"); int i= scanner.nextInt(); System.out.println("输入工资"); int j= scanner.nextInt(); late(i,j); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)