java-->方法案例(公司迟到措施)

//公司迟到罚款小案例
public class FangFaAnLI {
    public static void main(String[] args){
        sy(25,8000);
        sy(10,8000);
    }
    private static int sy(int s,int y){
        System.out.println("迟到分钟数:"+s);
        System.out.println("月薪"+y);
        int t=1;
        if(s<1&&s<=10){
            System.out.println("警告");
        }else if(s<=11&&s<=20){
            System.out.println("罚款100元");
            t=100;
        }else if(s<=21&&s<=30){
            System.out.println("罚款200元");
            t=200;
        }else if(s<30&&s<=60){
            System.out.println("罚款半日工资");
            t=y/45;
        }else if(s>60){
            System.out.println("矿工,罚款一天工资");
            t=y/60;
        }
        System.out.println(t+"元");
        return t;
    }
}

你可能感兴趣的:(学习,intellij-idea,开发语言,java,java-ee)