package baizhan2;
public class TestMethod {
public static void loveU(int num){
System.out.println("I love U!");
System.out.println("七夕快乐!"+"===="+num+"多少年");
}
public static int add(int a, int b, int c){
int sum = a+b+c;
return sum;
}
public static void main(String[] args){
loveU(1000);
int s = 1+add(100,200,300);
System.out.println(s);
}
}
package baizhan2;
public class TestMethod2 {
public static int late(int lateMinute,double salary){
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)(salary/(21.75*2)); // 21.75指的是:月平均工作日
}else
fakuan = (int)(salary*3/(21.75*2));
System.out.println("迟到时间:"+lateMinute+",罚款:" + fakuan);
return fakuan;
}
public static void main(String[] args){
late(45,18000);
}
}
|