binibiningtinamoran

Manager.java

Nov 25th, 2020 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. public class Manager extends Employee {
  2.  
  3.     /***
  4.      * Define Attributes
  5.      ***/
  6.  
  7.     // Maximum pay rate for a manager
  8.     private static final double MAX_PAY_RATE = 30.00;
  9.     // Set job title for Manager
  10.     private static final String MANAGER_TITLE = "Manager";
  11.  
  12.     // Constructor for bartender information
  13.     public Manager(String employeeID, String firstName, String lastName, double payRate) {
  14.         super(employeeID, firstName, lastName, payRate);
  15.         this.title = MANAGER_TITLE;
  16.     }
  17.  
  18.     // Set pay manager pay rate to not exceed base
  19.     @Override
  20.     public void setPayRate() {
  21.         if (payRate > MAX_PAY_RATE) {
  22.             this.payRate = MAX_PAY_RATE;
  23.         } else this.payRate = Math.max(payRate, MIN_PAY_RATE);
  24.     }
  25.  
  26.     // Set job title for manager
  27.     @Override
  28.     public void setTitle() {
  29.         this.title = MANAGER_TITLE;
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment