Advertisement
AustinShyd

Untitled

Apr 22nd, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.06 KB | None | 0 0
  1. // SUPERCLASS
  2.  
  3. // Austin Sheidy
  4. // 4.18.19
  5. // CH9PC1
  6.  
  7. public class AS_Employee {
  8.     private String employeeName;
  9.     private String employeeNumber;
  10.     private String hireDate;
  11.  
  12.     AS_Employee(){
  13.         this.employeeName = "Default";
  14.         this.employeeNumber = "Default";
  15.         this.hireDate = "Default";
  16.     }
  17.  
  18.     AS_Employee(String employeeName, String employeeNumber, String hireDate){
  19.         this.employeeName = employeeName;
  20.         this.employeeNumber = employeeNumber;
  21.         this.hireDate = hireDate;
  22.     }
  23.  
  24.     public void setEmployeeName(String employeeName) {
  25.         this.employeeName = employeeName;
  26.     }
  27.  
  28.     public void setEmployeeNumber(String employeeNumber) {
  29.         this.employeeNumber = employeeNumber;
  30.     }
  31.  
  32.     public void setHireDate(String hireDate) {
  33.         this.hireDate = hireDate;
  34.     }
  35.  
  36.     public String getEmployeeName() {
  37.         return employeeName;
  38.     }
  39.  
  40.     public String getEmployeeNumber() {
  41.         return employeeNumber;
  42.     }
  43.  
  44.     public String getHireDate() {
  45.         return hireDate;
  46.     }
  47.  
  48.  
  49. // SUBCLASS
  50.  
  51. // Austin Sheidy
  52. // 4.18.19
  53. // CH9PC1
  54.  
  55. public class AS_ProductionWorker extends AS_Employee{
  56.     private int shift;
  57.     private double hourlyRate;
  58.  
  59.     public AS_ProductionWorker(String name, String num, String date, int shift, double hourlyRate){
  60.         super(name, num, date);
  61.         this.shift = shift;
  62.         this.hourlyRate = hourlyRate;
  63.     }
  64.  
  65.     public void setHourlyRate(double hourlyRate) {
  66.         this.hourlyRate = hourlyRate;
  67.     }
  68.  
  69.     public void setShift(int shift) {
  70.         this.shift = shift;
  71.     }
  72.  
  73.     public double getHourlyRate() {
  74.         return hourlyRate;
  75.     }
  76.  
  77.     public int getShift() {
  78.         return shift;
  79.     }
  80.  
  81.     public String toString(){
  82.         return "Employee: " + getEmployeeName() + '\n'
  83.                 + "Employee ID: " + getEmployeeNumber() + '\n'
  84.                 + "Hired: " + getHireDate() + '\n'
  85.                 + "Shift: " + getShift() + '\n'
  86.                 + "Hourly Rate: " + getHourlyRate();
  87.     }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement