Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Employee;
- /**
- * HourlyEmployee
- */
- /**
- * @author Elhanan Brisk 325192862
- *
- */
- public class HourlyEmployee extends Employee
- {
- private int hours;
- private float wage;
- /**
- * Constructor with
- * @param FirstName
- * @param LastName
- * @param ID
- * @param Hours
- * @param Wage
- */
- public HourlyEmployee(String FirstName, String LastName, int ID, int Hours, float Wage)
- {
- super(FirstName, LastName, ID);
- this.hours = Hours;
- this.wage = Wage;
- }
- public HourlyEmployee()
- {
- super();
- this.hours = 0;
- this.wage = 0;
- }
- /**
- * @return the hours
- */
- public int getHours() {
- return hours;
- }
- /**
- * @param hours the hours to set
- */
- public void setHours(int hours) {
- this.hours = hours;
- }
- /**
- * @return the wage
- */
- public float getWage() {
- return wage;
- }
- /**
- * @param wage the wage to set
- */
- public void setWage(float wage) {
- this.wage = wage;
- }
- /**
- * @return the earnings
- */
- public float earnings()
- {
- return wage*hours;
- }
- @Override
- public String toString() {
- return "HourlyEmployee [hours=" + hours + ", wage=" + wage + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement