Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SalariedEmployee extends Employee
- {
- static double salary;
- public SalariedEmployee(String firstName, String lastName, String SINNumber, int startMonth, int startYear, double salary)
- {
- super(firstName, lastName, SINNumber, startMonth, startYear);
- }
- public static double getSalary()
- {
- return salary;
- }
- public static double setSalary()
- {
- return salary = setSalary();
- }
- public String getEmployeeDetails()
- {
- return ("This Employee is " + firstName + lastName + " this employee has the SIN " + sinNumber + "and is " + gender + ". This is a salaried employee");
- }
- int year = Calendar.getInstance().get(Calendar.YEAR);
- int month = Calendar.getInstance().get(Calendar.MONTH);
- int monthDifference = month = startMonth;
- int yearDifference = year - startYear;
- int totalMonths = monthDifference + (yearDifference * 12);
- // it would be like...salary times months times (year * 12) I think.
- public double getEarnings()
- {
- int earnings = (int) (salary * totalMonths);
- return earnings;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement