Commit 7e268de1 authored by Amirhosein Rajabpour's avatar Amirhosein Rajabpour

final commit

parent d9f25ffb
...@@ -4,6 +4,7 @@ import java.util.ArrayList; ...@@ -4,6 +4,7 @@ import java.util.ArrayList;
public class Professor extends AbstractEmployee public class Professor extends AbstractEmployee
{ {
private double income = 0;
private ArrayList<Course> courses; private ArrayList<Course> courses;
private ArrayList<Article> articles; private ArrayList<Article> articles;
private String group; private String group;
...@@ -12,6 +13,20 @@ public class Professor extends AbstractEmployee ...@@ -12,6 +13,20 @@ public class Professor extends AbstractEmployee
Department department, String position, double basicIncome, String group) { Department department, String position, double basicIncome, String group) {
super(firstName, lastName, ID, joiningYear, department, position, basicIncome); super(firstName, lastName, ID, joiningYear, department, position, basicIncome);
this.group = group; this.group = group;
this.income = 0;
}
public void income(Professor professor){
income = (professor.articles.size()*1000) + basicIncome;
}
public void setIncome(double income) {
this.income = income;
}
public double getIncome() {
return income;
} }
public void addArticle(Article a){ public void addArticle(Article a){
......
...@@ -4,14 +4,32 @@ import java.util.Date; ...@@ -4,14 +4,32 @@ import java.util.Date;
public class ServiceEmployee extends AbstractEmployee public class ServiceEmployee extends AbstractEmployee
{ {
double income = 0;
int additionalHour = 0;
public ServiceEmployee(String firstName, String lastName, String ID, int joiningYear, Department department, String position, double basicIncome) { public ServiceEmployee(String firstName, String lastName, String ID, int joiningYear, Department department, String position, double basicIncome) {
super(firstName, lastName, ID, joiningYear, department, position, basicIncome); super(firstName, lastName, ID, joiningYear, department, position, basicIncome);
this.income = 0;
} }
int passedDays = 0; int passedDays = 0;
public void setPassedDays(int passedDays) { public void setPassedDays(int passedDays) {
this.passedDays++; this.passedDays++;
} }
public void income(ServiceEmployee serviceEmployee){
income = ( additionalHour*500) + basicIncome;
}
public double getIncome() {
return income;
}
public void setIncome(double income) {
this.income = income;
}
public void setAdditionalHour(int additionalHour) {
this.additionalHour = additionalHour;
}
@Override @Override
public boolean isPromotable() { public boolean isPromotable() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment