Commit abb60a7a authored by 9731065's avatar 9731065

doing

parent 3d889f4f
Pipeline #602 canceled with stages
import java.util.ArrayList;
public class Employee extends Personnel {
private ArrayList<Report> reports = new ArrayList<>();
private int level;
public Employee (String name , double basicSalary , int level){
super(name , basicSalary);
this.level = level;
}
public ArrayList<Report> getReports() {
return reports;
}
public int getLevel() {
return level;
}
public void increaseLevel(){
if (this.level == 3)
return;
else {
this.level++;
}
}
public void decreaseLevel(){
if (this.level == 1)
return;
else {
this.level--;
}
}
}
import java.util.ArrayList;
public class Personnel {
protected ArrayList<Time> inTime = new ArrayList<>() ;
protected ArrayList<Time> outTime = new ArrayList<>() ;
protected String name;
protected double basicSalary;
protected double currentSalary;
public Personnel(String name , double basicSalary){
this.name = name;
this.basicSalary = basicSalary;
}
public String getName() {
return name;
}
public double getBasicSalary() {
return basicSalary;
}
public double getCurrentSalary() {
return currentSalary;
}
public void setInTime(Time inTime) {
this.inTime.add( inTime);
}
public void setOutTime(Time outTime) {
this.inTime.add( outTime);
}
}
public class Report {
private String report;
private Time time;
public Report (String report , Time time){
this.report = report;
this.time = time;
}
public String getReport() {
return report;
}
public Time getTime() {
return time;
}
}
public class Time {
int hour;
int minute;
int second;
String date;
public Time(int hour , int minute , int second , String date){
this.hour = hour;
this.minute = minute;
this.second = second;
this.date = date;
}
@Override
public String toString(){
return Integer.toString(hour) + " : " + Integer.toString(minute) + " : " + Integer.toString(second);
}
}
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