1.某公司的雇员分为以下若干类: 1)Employee:这是所有员工总的父类,属性:员工的姓名和生日月份。方法:getSalary(int month) 根据参数月份来确定工资, 如果该月员工过生日,则公司会额外奖励100元。2)SalaryEmployee:Employee的子类,拿固定工资的员工。属性:月薪3)HourlyEmployee:Employee的子类,按小时拿工资的员工,每月工作超出160小时的部分按照1.5倍工资发放。属性:每小时的工资、每月工作的小时数4)SalesEmployee:Employee的子类,销售人员,工资由月销售额和提成率决定。属性:月销售额、提成率5)BasePlusSalesEmployee:SalesEmployee的子类,有固定底薪的销售人员,工资由底薪加上销售提成部分。属性:底薪。  编程实现以上小题中的内容,并写一个类,在main()方法中进行测试*/class Employee{
private String name;
private String birth;
public Employee(String n, String b){
this.setName(n);
this.setBirth(b);
}
public void setName(String name){
this.name = name;
}
public void setBirth(String birth){
this.birth = birth;
}
public String getName(){
return name;
}
public String getBirth(){
return birth;
}
}
class SalaryEmployee extends Employee{
private  float salary ;
public void setSalary(float salary){
this.salary = salary;
}
public float getSalary(){
return salary;
}
public SalaryEmployee(String name ,String birth , float salary){
super(name ,birth);
this.salary=salary;
}
}
class HourlyEmployee extends Employee{
private float hourly;
private float time;
private float sumSalary=time*hourly;
public void setSumSalary(float sumSalary){
this.sumSalary = sumSalary;
}
public float getSumSalary(){
return sumSalary;
}
public void setHourly(float h){
hourly = h;
}
public float getHourly(){
return hourly;
}
public void setTime(float t){             //每月工作超出160小时的部分按照1.5倍工资发放
if(time>160f )
time = 1.5f*t;
else
time = t;
}
public float getTime(){
return time;
}
public HourlyEmployee(String name, String birth , float time, float hourly ){
super(name ,birth);
this.time= time;
this.hourly = hourly;
}
/*public float sumSalary(){
return time*hourly;
}*/
}
class SalesEmployee extends Employee{ 
private float sale;              //属性:月销售额、提成率
private float rate;
private float saleSalary=sale*rate;
public void setSalelary(float saleSalary){
this.saleSalary = saleSalary;
}
public float getSalesalary(){
return saleSalary;
}
public void setSale(float sale){
this.sale = sale;
}
public float getSale(){
return sale;
}
public void setRate(float rate){             
this.rate= rate ;
}
public float getRate(){
return rate;
} public SalesEmployee(String name, String birth , float sale, float rate){
super(name ,birth);
this.sale=sale ;
this.rate = rate;
}
}class BasePlusSalesEmployee extends SalesEmployee{                              //属性:底薪。
private float bsalary;

public void setBsalary(float bsalary){
this.bsalary = bsalary ;
}
public float getBsalary(){
return bsalary; //工资由底薪加上销售提成部分
}
public BasePlusSalesEmployee(String name, String birth , float sale, float rate,float bsalary){

super(name,birth,sale,rate);
this.bsalary=bsalary ;
        }

}
public class BankSalary{
public static void main(String args[]){
SalaryEmployee a =new SalaryEmployee("张三", "1990-1-2",5000);
System.out.println("姓名:"+a.getName()+",出生日期:"+a.getBirth()+",工资:"+a.getSalary());
HourlyEmployee b = new HourlyEmployee("李四", "1991.1.2",13f,250f );
System.out.println("姓名:"+b.getName()+",出生日期:"+b.getBirth()+",工资:"+b.getSumSalary());
SalesEmployee  c = new SalesEmployee ("王五", "1992.1.2",50f,200f );
System.out.println("姓名:"+c.getName()+",出生日期:"+c.getBirth()+",工资:"+c.getSaleSalary());
BasePlusSalesEmployee d = new BasePlusSalesEmployee ("赵六", "1989.6.2",50,200,4000);
System.out.println("姓名:"+name+",出生日期:"+birth+",工资:"+d.getSaleSalary()+d.getBsalary());
}
}继承 和封装