Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package Employee;
  2. /**
  3. * HourlyEmployee
  4. */
  5.  
  6. /**
  7. * @author Elhanan Brisk 325192862
  8. *
  9. */
  10. public class HourlyEmployee extends Employee
  11. {
  12. private int hours;
  13. private float wage;
  14. /**
  15. * Constructor with
  16. * @param FirstName
  17. * @param LastName
  18. * @param ID
  19. * @param Hours
  20. * @param Wage
  21. */
  22. public HourlyEmployee(String FirstName, String LastName, int ID, int Hours, float Wage)
  23. {
  24. super(FirstName, LastName, ID);
  25. this.hours = Hours;
  26. this.wage = Wage;
  27. }
  28. public HourlyEmployee()
  29. {
  30. super();
  31. this.hours = 0;
  32. this.wage = 0;
  33. }
  34. /**
  35. * @return the hours
  36. */
  37. public int getHours() {
  38. return hours;
  39. }
  40. /**
  41. * @param hours the hours to set
  42. */
  43. public void setHours(int hours) {
  44. this.hours = hours;
  45. }
  46. /**
  47. * @return the wage
  48. */
  49. public float getWage() {
  50. return wage;
  51. }
  52. /**
  53. * @param wage the wage to set
  54. */
  55. public void setWage(float wage) {
  56. this.wage = wage;
  57. }
  58. /**
  59. * @return the earnings
  60. */
  61. public float earnings()
  62. {
  63. return wage*hours;
  64. }
  65. @Override
  66. public String toString() {
  67. return "HourlyEmployee [hours=" + hours + ", wage=" + wage + "]";
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement