Skip to content
Snippets Groups Projects
Commit 5484556e authored by Daniel Shchur's avatar Daniel Shchur
Browse files

Update Stuff, moving from eclipse.

parent 8992bde5
Branches
Tags
No related merge requests found
Showing with 117 additions and 0 deletions
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
package org.cinco.payroll;
public abstract class HourlyEmployee extends Employee{
private double hourlyPayRate;
private double hoursWorked;
public double getHourlyPayRate() {
return hourlyPayRate;
}
public void setHourlyPayRate(double hourlyPayRate) {
this.hourlyPayRate = hourlyPayRate;
}
public double getHoursWorked() {
return hoursWorked;
}
public void setHoursWorked(double hoursWorked) {
this.hoursWorked = hoursWorked;
}
public double getGrossIncome() {
return this.hourlyPayRate * this.hoursWorked;
}
public abstract String getType();
public abstract double getNetIncome();
public abstract double getTaxes();
public HourlyEmployee(String id, String lastName, String firstName, String title, String type, double hourlyPayRate,
double hoursWorked) {
super(id, lastName, firstName, title, type);
this.hourlyPayRate = hourlyPayRate;
this.hoursWorked = hoursWorked;
}
}
package org.cinco.payroll;
public class SalariedEmployee extends Employee{
private double grossIncome;
public String getType() {
return "Salaried";
}
public double getGrossIncome() {
return grossIncome;
}
public void setGrossIncome(double annualSalary) {
this.grossIncome = annualSalary / 52;
}
public double getTaxes(){
return this.grossIncome * 0.20;
}
public double getNetIncome() {
return this.grossIncome = this.grossIncome - getTaxes() + 100;
}
public SalariedEmployee(String id, String lastName, String firstName, String title, String type, double annualSalary) {
super(id, lastName, firstName, title, type);
this.grossIncome = annualSalary / 52;
}
}
package org.cinco.payroll;
public class StaffedHourlyEmployee extends HourlyEmployee{
public String getType() {
return "Staffed";
}
public double getNetIncome() {
double gross = this.getGrossIncome();
return gross -= gross * 0.15;
}
public double getTaxes() {
return this.getGrossIncome() * 0.15;
}
public StaffedHourlyEmployee(String id, String lastName, String firstName, String title, String type, double hourlyPayRate,
double hoursWorked) {
super(id, lastName, firstName, title, type, hourlyPayRate, hoursWorked);
}
}
package org.cinco.payroll;
public class TempHourlyEmployee extends HourlyEmployee{
public String getType() {
return "Temporary";
}
public double getNetIncome() {
return this.getGrossIncome();
}
public double getTaxes() {
return 0;
}
public TempHourlyEmployee(String id, String lastName, String firstName, String title, String type, double hourlyPayRate,
double hoursWorked) {
super(id, lastName, firstName, title, type, hourlyPayRate, hoursWorked);
}
}
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment