package junior;

import base.Scientist;
import base.EmployeeActions;

public class JuniorScientist implements Scientist, EmployeeActions {
    private double salary;
    private int seniority;

    public JuniorScientist(double salary, int seniority) {
        this.salary = salary;
        this.seniority = seniority;
    }

    @Override
    public double computeBonus() {
        return salary * seniority * 0.02;
    }

    @Override
    public double getSalary() {
        return salary;
    }

    @Override
    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public int getSeniority() {
        return seniority;
    }

    @Override
    public void setSeniority(int seniority) {
        this.seniority = seniority;
    }

    @Override
    public void hire() {
        System.out.println("Junior Scientist hired.");
    }

    @Override
    public void fire() {
        System.out.println("Junior Scientist fired.");
    }

    @Override
    public void transfer() {
        System.out.println("Junior Scientist transferred.");
    }

    @Override
    public void accrueSalary() {
        System.out.println("Total salary: " + (salary + computeBonus()));
    }

    @Override
    public String toString() {
        return "JuniorScientist { salary = " + salary +
                ", seniority = " + seniority +
                ", bonus = " + computeBonus() +
                ", totalSalary = " + (salary + computeBonus()) + " }";
    }
}
