0

Can anyone please define me this hierarchy? How to solve this?

Create the following OOP class hierarchy:   Person – general class for anyone, holding id, first name and last name. o Employee – general class for all employees, holding the field salary and department. The department can only be one of the following: Production, Accounting, Sales or Marketing.   Manager – holds a set of employees under his command.   RegularEmployee  - SalesEmployee – holds a set of sales. A sale holds product name, date and price.  - Developer – holds a set of projects. A project hold

21st Oct 2017, 4:27 PM
Usama Zafar
Usama Zafar - avatar
1 Odpowiedź
0
abstract class Person { private int id; private String firstName; private String lastName; } public class Employee extends Person { private Double salary; private Department department; } public class Manager { private ArrayList<Employee> employees; } public enum Department { PRODUCTION, ACCOUNTING, SALES, MARKETING } abstract class RegularEmployee { } public class SalesEmployee extends RegularEmployee { private String productName; private Date date; private Double price; } public class Developer extends RegularEmployee { private ArrayList<Project> projects; } public class Project { }
27th Oct 2017, 9:24 PM
Eugene Fedorov
Eugene Fedorov - avatar