Advertisement
binibiningtinamoran

Bartender.java

Nov 25th, 2020 (edited)
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. public class Bartender extends Employee {
  2.  
  3.     /***
  4.      * Define Attributes
  5.      ***/
  6.  
  7.     // Maximum pay rate for a bartender
  8.     private static final double MAX_PAY_RATE = 18.00;
  9.     // Set job title for bartender
  10.     private static final String BARTENDER_TITLE = "Bartender";
  11.  
  12.     // Constructor for bartender information
  13.     public Bartender(String employeeID, String firstName, String lastName, double payRate) {
  14.         super(employeeID, firstName, lastName, payRate);
  15.         this.title = BARTENDER_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 {
  24.             this.payRate = Math.max(payRate, MIN_PAY_RATE);
  25.         }
  26.     }
  27.  
  28.     // Set job title for bartender
  29.     @Override
  30.     public void setTitle() {
  31.         this.title = BARTENDER_TITLE;
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement