Employee.ava import java.util.Calendar; import java.util.GregorianCalendar; public class Employee { /** * Employee:这是所有员工总的父类,属性:员工的姓名和生日月份。方法:getSalary(int month) 根据参数月份来确定工资, * 如果该月员工过生日,则公司会额外奖励 100 元。 */ private String name; protected int month; private int base = 6000; private int salary; public Employee() { } public Employee(String name, int month) { this.setName(name); this.setMonth(month); } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getMonth() { return month; } public void setMonth(int month) { this.month = month; } GregorianCalendar g = new GregorianCalendar(); int flag = (int) g.get(Calendar.MONTH) + 1; public int getSalary(int month) { int s = this.getMonth(); if (flag == s) { salary = base + 100; } else salary = base; return salary; } void says() { System.out.println("当前月份:" + flag); } } // SalaryEmployee:Employee 的子类,拿固定工资的员工。属性:月薪 class SalaryEmployee extends Employee { private int base = 6000; private int salary; public SalaryEmployee(String name, int month) { super(name, month); } public int getSalary(int month) { int s = this.getMonth(); if (flag == s) { salary = base + 100; } else { salary = base; } return salary; } void says() { System.out.println(" " + "姓名:" + this.getName() + " " + "生日所在月:" + this.getMonth() + " " + "所得薪酬:" + getSalary(month)); } } // HourlyEmployee:Employee 的子类,按小时拿工资的员工,每月工作超出160 小时的部分按照1.5 倍工资发放。 // 属性:每小时的工资、每月工作的小时数 class HourlyEmployee extends Employee { private int hours; private int basehour = 35; private int salary; public HourlyEmployee(String name, int month, int hours) { ...