/** Un empleado que cobra por hora trabajada en el mes. */
public class HourlyEmployee extends Employee {
    private final long hourlyRate;      // céntimos por hora
    private final int hours;

    public HourlyEmployee(String name, long hourlyRate, int hours) {
        super(name);
        this.hourlyRate = hourlyRate;
        this.hours = hours;
    }

    @Override
    public long monthlyPay() {
        return hourlyRate * hours;
    }

    @Override
    public String payslip() {
        return super.payslip() + " (" + hours + " h)";
    }
}
