Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SUPERCLASS
- // Austin Sheidy
- // 4.18.19
- // CH9PC1
- public class AS_Employee {
- private String employeeName;
- private String employeeNumber;
- private String hireDate;
- AS_Employee(){
- this.employeeName = "Default";
- this.employeeNumber = "Default";
- this.hireDate = "Default";
- }
- AS_Employee(String employeeName, String employeeNumber, String hireDate){
- this.employeeName = employeeName;
- this.employeeNumber = employeeNumber;
- this.hireDate = hireDate;
- }
- public void setEmployeeName(String employeeName) {
- this.employeeName = employeeName;
- }
- public void setEmployeeNumber(String employeeNumber) {
- this.employeeNumber = employeeNumber;
- }
- public void setHireDate(String hireDate) {
- this.hireDate = hireDate;
- }
- public String getEmployeeName() {
- return employeeName;
- }
- public String getEmployeeNumber() {
- return employeeNumber;
- }
- public String getHireDate() {
- return hireDate;
- }
- // SUBCLASS
- // Austin Sheidy
- // 4.18.19
- // CH9PC1
- public class AS_ProductionWorker extends AS_Employee{
- private int shift;
- private double hourlyRate;
- public AS_ProductionWorker(String name, String num, String date, int shift, double hourlyRate){
- super(name, num, date);
- this.shift = shift;
- this.hourlyRate = hourlyRate;
- }
- public void setHourlyRate(double hourlyRate) {
- this.hourlyRate = hourlyRate;
- }
- public void setShift(int shift) {
- this.shift = shift;
- }
- public double getHourlyRate() {
- return hourlyRate;
- }
- public int getShift() {
- return shift;
- }
- public String toString(){
- return "Employee: " + getEmployeeName() + '\n'
- + "Employee ID: " + getEmployeeNumber() + '\n'
- + "Hired: " + getHireDate() + '\n'
- + "Shift: " + getShift() + '\n'
- + "Hourly Rate: " + getHourlyRate();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement