public class Staff {
public void Wages(double dailyWage,int Days,double wageGrades){
double Wages = dailyWage * Days * wageGrades;
System.out.println("员工工资为:"+Wages);
}
}
public class GeneralStaff extends Staff{
@Override
public void Wages(double dailyWage, int Days, double wageGrades) {
double Wages = dailyWage * Days * wageGrades;
System.out.println("普通员工工资为:"+Wages);
}
}
public class Manager extends Staff{
@Override
public void Wages(double dailyWage, int Days, double wageGrades) {
double Wages = dailyWage * Days * wageGrades + 1000.0;
System.out.println("部门经理工资为:"+Wages);
}
}
public class Test {
public static void main(String[] args) {
Staff staff = new GeneralStaff();
Staff staff1 = new Manager();
staff.Wages(500,30,1);
staff1.Wages(600,30,1.2);
}
}