Class Employee

Class Employee

java.lang.Object
   |
   +----Person
           |
           +----Employee

public class Employee
extends Person
The Employee class is used to represent employees of our company. It augments the Person class with information about an employee's salary and job title.

This class was written by:

Version:
1.0.0
Author:
Mike Cohn
See Also:
Contractor

Constructor Index

 o Employee(float, String, String)
This constructor is used to create a new employee and assign him an initial salary.

Method Index

 o AssignJob(String)
This method assigns the employee to the specified job.
 o ChangeSalary(float)
This function changes the employees salary.
 o GetJobTitle()
This function returns the job title of the employee.
 o GetMaxWorkingAge()
This method return the highest age at which an employee can remain at work.

Constructors

 o Employee
  public Employee(float sal,
                  String fName,
                  String lName)
This constructor is used to create a new employee and assign him an initial salary. It does not verify that salary is less than the company's maximum salary. You could use this method as follows:
Employee Emp = new Employee(35000f,"Mike","Cohn");
Parameters:
sal - The starting salary of the new employee.
fName - The employee's first name.
lName - The employee's last name.

Methods

 o AssignJob
  public void AssignJob(String newJob)
This method assigns the employee to the specified job. This method does not verify the job title against the list of approved job titles created by Human Resources. Likely job titles you may want to pass include: Reminder: All positions must be approved by the Manager of Human Resources according to the company's Employee Hiring Guidelines.
Parameters:
newJob - This is the new job title.
See Also:
GetJobTitle
 o GetJobTitle
  public String GetJobTitle()
This function returns the job title of the employee.
Returns:
A string representing the job title (for example, "programmer").
See Also:
AssignJob
 o GetMaxWorkingAge
  public static int GetMaxWorkingAge()
This method return the highest age at which an employee can remain at work. After this age, an employee must retire and move to Florida.
Returns:
The last allowable working year before mandatory retirement.
 o ChangeSalary
  public boolean ChangeSalary(float newSalary)
This function changes the employees salary. A salary change can occur only after the two following tests have been applied:
  1. The new salary is higher than the current salary.
  2. The new salary is less than the maximum salary.
Parameters:
newSalary - The proposed new salary.
Returns:
true if the salary change is approved, false otherwise.