Company Employee -name: String -arrEmps am String -Tank: int yearsofExperince: int +Company (name: String, size: int) +a
Posted: Sat May 14, 2022 4:45 pm
Company Employee -name: String -arrEmps am String -Tank: int yearsofExperince: int +Company (name: String, size: int) +addEmployee (o: Employee) - Boolean displayAllo) +count Consultant() int -getRighSalary(s: double): Employee 11 getManagers (n: Int): Manager 11 +Emlpoyee (nase: String, rank: int, yearsOfExperince: ant) getRank(): int getYearsOfExperience () int display calculateSalary(): double Manager Consultant -nbemps: int +Manager (name: String, rank: int, yearsOfExperince: Int, nbEmpa: int) +getEmp() int display() +calculateSalary(): double -hours PerWeek: int Consultant (name: String, rank: int, yearsOfExperince: Int, hours per week: int) +display) *calculateSalary(): double Employee class: O Attributes: • name: the name of the employee. • rank: rank in the company structure (1-15). • yearsOfExperience: number of years of experience for the employee. o Methods: Employee (name: String, rank: int, yearsOfExperience: int): constructor getRank(): this method returns the rank of employee. get YearsOfExperience (): returns the years of experience of the employee. display(): this method display all the attributes of the employee. o calculateSalary): this method calculates and return the Salary of the employee as the following: Employee: years of experience * 500 + rank * 1000 Manager: years of experience * 500 + rank * 1500+ nbOfEmps * 10 Consultant: hours Per Week * 1000 + rank *500 o o College of Applied Computer Science, King Saud University COS 102 Manager class: O Attributes: • nbEmps: number of employees managed. o Methods: Manager (name: String, rank: int, yearsOfExperience: int, nbEmps: int): constructor display(): this method display all the attributes of the manager. getNbEmps(): this method returns the rank of employee. Consultant class: O Attributes: • hours PerWeek: number of hours per week. O Methods: College of Applied Computer Science, King Saud University COS 102 Consultant(name: String, rank: int, yearsOfExperience: int, hoursPerWeek: int): constructor display(): this method display all the attributes of the consultant. Company class: O Attributes: • name: the name of the company. o Methods: Company (name: String, size: int): constructor addEmployee(Employee e): this method adds an employee to the company. An employee can be of type Employee, type Manager or type Consultant. displayAll (): Display all employees and their attributes along with their salary. countConsultant(): this method returns the number of all Consultants in the company College of Applied Computer Science, King Saud University COS 102 public Employee[] getHighSalary(double s): this method returns all employees having a salary greater than s.