Commit e416a740 authored by armin's avatar armin

callCurrentIncome va Override doros shod

parent 3b278a1a
...@@ -19,6 +19,8 @@ public abstract class AbstractEmployee extends Person implements AccountingInter ...@@ -19,6 +19,8 @@ public abstract class AbstractEmployee extends Person implements AccountingInter
public abstract boolean isPromotable(); public abstract boolean isPromotable();
public abstract double callCurrentIncome() ;
public void addBankStatement(Statement s) public void addBankStatement(Statement s)
{ {
bankStatments.add(s); bankStatments.add(s);
...@@ -29,8 +31,6 @@ public abstract class AbstractEmployee extends Person implements AccountingInter ...@@ -29,8 +31,6 @@ public abstract class AbstractEmployee extends Person implements AccountingInter
return this; return this;
} }
public abstract double callCurrentIncome() ;
public ArrayList<Statement> getBankStatments() { public ArrayList<Statement> getBankStatments() {
return bankStatments; return bankStatments;
} }
...@@ -56,7 +56,7 @@ public abstract class AbstractEmployee extends Person implements AccountingInter ...@@ -56,7 +56,7 @@ public abstract class AbstractEmployee extends Person implements AccountingInter
this.currentIncome = currentIncome; this.currentIncome = currentIncome;
} }
public double calCurrentIncome() public double getCurrentIncome()
{ {
return currentIncome; return currentIncome;
} }
......
...@@ -9,8 +9,9 @@ public class Professor extends AbstractEmployee { ...@@ -9,8 +9,9 @@ public class Professor extends AbstractEmployee {
private double income = 0 ; private double income = 0 ;
public Professor(String firstName, String lastName, String ID, int joiningYear, Department department, String position, double basicIncome, String group) { public Professor(String firstName, String lastName, String ID, int joiningYear, 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 addArticle(Article article){ public void addArticle(Article article){
...@@ -21,8 +22,8 @@ public class Professor extends AbstractEmployee { ...@@ -21,8 +22,8 @@ public class Professor extends AbstractEmployee {
return articles ; return articles ;
} }
public void income (Professor p){ public void income (Professor professor){
income = (p.articles.size())*1000 + basicIncome ; income = (professor.articles.size())*1000 + basicIncome ;
} }
public void setIncome(double income){ public void setIncome(double income){
...@@ -45,6 +46,6 @@ public class Professor extends AbstractEmployee { ...@@ -45,6 +46,6 @@ public class Professor extends AbstractEmployee {
@Override @Override
public double callCurrentIncome() { public double callCurrentIncome() {
return 0; return getIncome() ;
} }
} }
...@@ -2,18 +2,34 @@ package org.university.core; ...@@ -2,18 +2,34 @@ package org.university.core;
public class ServiceEmployee extends AbstractEmployee public class ServiceEmployee extends AbstractEmployee
{ {
int passedDays = 0 ;
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 ;
double income ;
public void setPassedDays(int passedDays){ public void setPassedDays(int passedDays){
this.passedDays ++ ; this.passedDays ++ ;
} }
public void income(ServiceEmployee s){ public void income(ServiceEmployee serviceEmployee){
income = 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
...@@ -29,7 +45,12 @@ public class ServiceEmployee extends AbstractEmployee ...@@ -29,7 +45,12 @@ public class ServiceEmployee extends AbstractEmployee
@Override @Override
public double callCurrentIncome() { public double callCurrentIncome() {
return 0; return getIncome() ;
}
@Override
public AbstractEmployee callEmployee() {
return null;
} }
......
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