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