Commit da7b0e85 authored by 9731065's avatar 9731065

FINISHED

parent b4e2cb53
Pipeline #603 failed with stages
public interface AddingAndRemoving {
// void add(Personnel p);
// void remove(Personnel p);
void changeLevel(Employee e , int change);
}
public class Assistant extends Utility {
public Assistant(String name, double basicSalary) {
super(name, basicSalary);
}
@Override
public void checkReports(Personnel p){
Management manager = (Management) p;
for (int i = 0; i < manager.getReports().size(); i++) {
System.out.println(manager.getReports().get(i));
}
}
}
...@@ -29,4 +29,7 @@ public class Employee extends Personnel { ...@@ -29,4 +29,7 @@ public class Employee extends Personnel {
this.level--; this.level--;
} }
} }
public void addReport(Report r){
reports.add(r);
}
} }
public class FinancialManagment extends Management {
public FinancialManagment(String name, double basicSalary) {
super(name, basicSalary);
}
public void checkSalary(Employee e){
System.out.println(e.getCurrentSalary());
}
}
public class HumanManagement extends Management implements AddingAndRemoving {
public HumanManagement(String name, double basicSalary) {
super(name, basicSalary);
}
@Override
public void changeLevel(Employee e, int change) {
if (change == +1)
e.increaseLevel();
else if (change == -1)
e.decreaseLevel();
}
}
import java.util.ArrayList;
public class Management extends Utility {
private ArrayList<Report> reports = new ArrayList<>();
public Management(String name, double basicSalary) {
super(name, basicSalary);
}
@Override
public void checkReports(Personnel p){
Employee employee = (Employee)p;
for (int i = 0; i < employee.getReports().size(); i++) {
System.out.println(employee.getReports().get(i));
}
}
public void addReport(Report r){
reports.add(r);
}
public ArrayList<Report> getReports() {
return reports;
}
}
public abstract class Utility extends Personnel {
public Utility(String name, double basicSalary) {
super(name, basicSalary);
}
public abstract void checkReports(Personnel p);
}
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