In: Computer Science
XYZ holdings have many branches. Each branch has a
name and is located in a different province.
Each branch has several departments such as marketing, finance,
sales and customer relations.
For a department to exist there must be employees employed in each
of the departments.
An employee is ether a permanent staff member or a temporary staff
member. The difference
between these two types of employees exist in the facts that
permanent staff earns a fixed salary
of R30 000 every month and has a medical aid benefit whereas
temporary staff members has an
hourly rate of R400 per hour and their monthly salary is dependent
on the number of hours
worked each month multiplied by their hourly rate. Temporary staff
members also do not have a
medical aid benefit. All employees, however, have a name, surname
and employee number.
Question 1 (Marks: 45)
Answer all questions within this section based on the information
contained in the scenario.
Q.1.1 Based on the information contained in the scenario, create a
class diagram which
will address/ contain the following elements:
Q.1.1.1 Five classes called Branch, Department, Employee,
PermanentEmployee
and TemporaryEmployee.
(5)
Q.1.1.2 An appropriate relationships between class Branch,
Department and
Employee.
(4)
Q.1.1.3 An appropriate relationship between Employee,
PermanentEmployee
and TemporaryEmployee.
(3)
Q.1.1.4 Two instance variables declared in class Branch as well as
accompanying
getter and setter methods for each instance variable.
(6)
Q.1.1.5 One instance variable declared in class Department as well
as
accompanying getter and setter methods for the instance
variable.
(3)
Q.1.1.6 Three instance variables declared in class Employee as well
as
accompanying getter and setter methods for each instance
variable.
(9)
Q.1.1.7 Two instance variables declared in class PermanentEmployee
as well as
appropriate getter and setter methods and a parameterized
constructor.
Java programming
Logic and Design
The below figure shows the relationships between all the classes
note: plzzz don't give dislike.....plzzz comment if you have any problem i will try to solve your problem.....plzzz give thumbs up i am in need....