import java. time. LocalDate;
public class Employee {
private String name;
private double salary;
private LocalDate hireDay;
public Employee ( String name, double salary, int year, int month, int day)
{
this . name= name;
this . salary= salary;
this . hireDay= LocalDate. of ( year, month, day) ;
}
public String getName ( ) {
return name;
}
public double getSalary ( ) {
return salary;
}
public LocalDate getHireDay ( ) {
return hireDay;
}
}
import java. time. LocalDate;
public class Manager extends Employee {
private double bonus;
public Manager ( String name, double salary, int year, int month, int day)
{
super ( name, salary, year, month, day) ;
bonus= 0 ;
}
public double getSalary ( )
{
double baseSalary= super . getSalary ( ) ;
baseSalary+= bonus;
return baseSalary;
}
public void setBonus ( double bonus)
{
this . bonus= bonus;
}
}
public class test
{
public static void main ( String args [ ] )
{
Manager manager= new Manager ( "Mike" , 2500 , 2018 , 7 , 5 ) ;
manager. setBonus ( 200 ) ;
System. out. println ( manager. getSalary ( ) ) ;
}
}