Advertisement
binibiningtinamoran

Server.java

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