asked on
ASKER
ASKER
ASKER
public class ProductionWorker extends Employee
{
//value of how much a production worker makes hourly
protected static double hourlySalary = 50.00;
//constructor that calls variables from Class Employee to create object ProductionWorker
public ProductionWorker(String eName,String eNumber,int hireYear, double hourlySalary)
{
super(eName,eNumber,hireYear);
if(super.validateENumber(eNumber))
{
this.eNumber = eNumber;
}
else
this.eNumber = employeeNumber();
this.hourlySalary = hourlySalary;
}
public double getHourlySalary()
{
return hourlySalary;
}
public void setHourlySalary(double salary)
{
this.hourlySalary = salary;
}
public String toString()
{
return (eName + "," + eNumber + "," + hireYear + "," + weeklySalary);
}
/**
* Equals method
*/
public boolean equals(ProductionWorker worker)
{
if(hourlySalary == worker.getHourlySalary())
return true;
return false;
}
public String getSalary()
{
String perSalary ="$" + hourlySalary + " per Hour";
return perSalary;
}
}
public class ProductionWorker extends Employee
{
//value of how much a production worker makes hourly
protected static double hourlySalary = 50.00;
//constructor that calls variables from Class Employee to create object ProductionWorker
public ProductionWorker(String eName,String eNumber,int hireYear, double hourlySalary)
{
super(eName,eNumber,hireYear);
if(super.validateENumber(eNumber))
{
this.eNumber = eNumber;
}
else
this.eNumber = Employee.employeeNumber();
this.hourlySalary = hourlySalary;
}
public double getHourlySalary()
{
return hourlySalary;
}
public void setHourlySalary(double salary)
{
this.hourlySalary = salary;
}
public String toString()
{
return (eName + "," + eNumber + "," + hireYear + "," + weeklySalary);
}
/**
* Equals method
*/
public boolean equals(ProductionWorker worker)
{
if(hourlySalary == worker.getHourlySalary())
return true;
return false;
}
public String getSalary()
{
String perSalary ="$" + hourlySalary + " per Hour";
return perSalary;
}
}
public class ShiftSuperVisor extends Employee
{
// instance variables - replace the example below with your own
protected static double yearlySalary = 80000.00;
protected int goal;
/**
* Constructor for objects of class ShiftSuperVisor
*/
public ShiftSuperVisor(String eName,String eNumber,int hireYear,
double yearlySalary, int goals)
{
super(eName,eNumber,hireYear);
if(super.validateENumber(eNumber))
{
this.eNumber = eNumber;
}
else
this.eNumber = Employee.employeeNumber();
this.yearlySalary = yearlySalary;
goal = goals;
}
public double getYearlySalary()
{
return yearlySalary;
}
public void setYearlySalary(double salary)
{
this.yearlySalary = salary;
}
public void setGoal(int goal)
{
this.goal = goal;
}
public int getGoal()
{
return goal;
}
public String toString()
{
return (eName + "," + eNumber + "," + hireYear + "," + weeklySalary + "," + yearlySalary);
}
/**
* Equals method
*/
public boolean equals(ShiftSuperVisor visor)
{
if(goal == visor.getGoal())
if(yearlySalary == visor.getYearlySalary())
return true;
return false;
}
public String getSalary()
{
String perSalary ="$" + yearlySalary + " per Year";
return perSalary;
}
}
ASKER
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.
TRUSTED BY