Advertisement
Guest User

Untitled

a guest
Mar 9th, 2012
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. public class SalariedEmployee extends Employee
  2. {
  3.  
  4. static double salary;
  5.  
  6. public SalariedEmployee(String firstName, String lastName, String SINNumber, int startMonth, int startYear, double salary)
  7. {
  8. super(firstName, lastName, SINNumber, startMonth, startYear);
  9. }
  10.  
  11.  
  12. public static double getSalary()
  13. {
  14. return salary;
  15. }
  16. public static double setSalary()
  17. {
  18. return salary = setSalary();
  19. }
  20.  
  21.  
  22. public String getEmployeeDetails()
  23. {
  24. return ("This Employee is " + firstName + lastName + " this employee has the SIN " + sinNumber + "and is " + gender + ". This is a salaried employee");
  25.  
  26. }
  27.  
  28. int year = Calendar.getInstance().get(Calendar.YEAR);
  29. int month = Calendar.getInstance().get(Calendar.MONTH);
  30.  
  31. int monthDifference = month = startMonth;
  32. int yearDifference = year - startYear;
  33.  
  34. int totalMonths = monthDifference + (yearDifference * 12);
  35.  
  36. // it would be like...salary times months times (year * 12) I think.
  37.  
  38. public double getEarnings()
  39. {
  40. int earnings = (int) (salary * totalMonths);
  41. return earnings;
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement