Employee.java.html

  1  /**
  2     An employee has a name and a mechanism for computing weekly pay.
  3  */
  4  public class Employee
  5  {
  6     private String name;
  7  
  8     /**
  9        Constructs an employee with an empty name.
 10     */
 11     public Employee()
 12     {
 13        name = "";
 14     }
 15  
 16     /**
 17        Sets the name of this employee.
 18        @param employee_name the new name 
 19     */
 20     public void setName(String employeeName)
 21     {
 22        name = employeeName;
 23     }
 24  
 25     /**
 26        Gets the name of this employee.
 27        @return the name 
 28     */
 29     public String getName()
 30     {
 31        return name; 
 32     }
 33  
 34     /**
 35        Computes the pay for one week of work.
 36        @param hoursWorked the number of hours worked in the week
 37        @return the pay for the given number of hours
 38     */
 39     public double weeklyPay(int hoursWorked)
 40     {
 41        return 0; 
 42     }
 43  }