Commit 472e1a5d authored by 9731050's avatar 9731050

6th

parent 7efa2917
package org.university.core;
import java.util.ArrayList;
public abstract class AbstractEmployee extends Person implements AccountingInterface{
protected ArrayList<Statement> bankStatments = new ArrayList<Statement>();
protected String position;
protected double basicIncome,currentIncome;
public AbstractEmployee(String firstName, String lastName, String ID, int joiningYear, Department department, String position, double basicIncome) {
super(firstName, lastName, ID, joiningYear, department);
this.position = position;
this.basicIncome = basicIncome;
}
public abstract boolean isPromotable();
public void addBankStatement(Statement s) { bankStatments.add(s); }
@Override
public AbstractEmployee callEmployee() {
return this;
}
@Override
public double callCurrentIncome() {
return callCurrentIncome();
}
public ArrayList<Statement> getBankStatments() {
return bankStatments;
}
public String getPosition() {
return position;
}
public void setPosition(String position) { this.position = position; }
public double getBasicIncome() {
return basicIncome;
}
public void setBasicIncome(double basicIncome) { this.basicIncome = basicIncome; }
public void setCurrentIncome(double currentIncome) { this.currentIncome = currentIncome; }
public double calCurrentIncome()
{
return currentIncome;
}
}
package org.university.core;
public interface AccountingInterface {
public AbstractEmployee callEmployee();
public double callCurrentIncome();
}
package org.university.core;
public class Statement {
private double amount;
private AbstractEmployee reciever;
public Statement(double amount, AbstractEmployee reciever) {
this.amount = amount;
this.reciever = reciever;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public AbstractEmployee getReciever() {
return reciever;
}
public void setReciever(AbstractEmployee reciver) {
this.reciever = reciever;
}
}
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