Question

In: Computer Science

Scenario to be used for question :: XYZ holdings have many branches. Each branch has a...

Scenario to be used for question ::

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 either 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 $30 000 every month and has a medical aid benefit whereas temporary staff members has an hourly rate of $400 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.

                                         

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.

Q.1.1.2 An appropriate relationships between class Branch, Department and Employee.


Q.1.1.3 An appropriate relationship between Employee, PermanentEmployee and TemporaryEmployee.

Q.1.1.4 Two instance variables declared in class Branch as well as accompanying getter and setter methods for each instance variable.

Q.1.1.5 One instance variable declared in class Department as well as accompanying getter and setter methods for the instance variable.

Q.1.1.6 Three instance variables declared in class Employee as well as accompanying getter and setter methods for each instance variable.

Q.1.1.7 Two instance variables declared in class PermanentEmployee as well as appropriate getter and setter methods and a parameterized constructor.

Q1.1.8: Three instance variables declared in class TemporaryEmployee as well as appropriate getter and setter methods and a parameterized constructor

Q1.1.9: Each element must be indicated using the correct notation

Solutions

Expert Solution

ANSWER:

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.

The below figure shows the relationships between all the classes:

1.1.1) All classes are shown in the above figure

1.1.2) Branch and Department follow a relationship of composition (from Department to Branch). This means that a department always exists under a branch. If a branch ceases to exist, the departments will also cease to exist. However, this condition is not explicitly mentioned in the problem.

Department and Employee also follow a relationship of composition but in reverse. This means that a department always only because of its employees. If there are no employees, the departments will also cease to exist.

1.1.3) Relation between Employee and Permanent employee & Temporary employee is that of inheritance. This means that Permanent employee & Temporary employee inherit all attributes and methods of Employee class. They also have their own exclusive attributes and methods as well.

1.1.4) Shown in the attached figure.

1.1.5) Shown in the attached figure.

1.1.6) Shown in the attached figure.

1.1.7) Shown in the attached figure.

//PLEASE UPVOTE//


Related Solutions

XYZ holdings have many branches. Each branch has a name and is located in a different...
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...
3) ABC bank has many branches; XYZ bank has relatively few branches. Both banks are the...
3) ABC bank has many branches; XYZ bank has relatively few branches. Both banks are the same size - $100 billion in assets - and operate in a five state region. Compare/contrast likely differences in the expenses incurred by ABC relative to XYZ. 4) a) What are the reasons for “consolidation” of the financial services industry? b) When a low-risk firm combines with a high-risk firm, what can we say about the risk of the conglomerate relative to that of...
Name the two branches of the autonomic nervous system, describe the function of each branch, and...
Name the two branches of the autonomic nervous system, describe the function of each branch, and state the changes that occur in various target organs during the "fight-or-flight" response.
Identify the separation of powers between the three branches of government. Then, discuss how each branch checks and balances the other branches.
Write a 1,050- to 1,400-word essay that addresses the following: Identify the separation of powers between the three branches of government. Then, discuss how each branch checks and balances the other branches. Select and discuss a current event or issue from the past 5 years (possible areas include: health care reform, presidential appointments, and national security, for example). Then, discuss 1) how the separation of powers affects this issue and 2) how the checks and balances affects this issue.
Please identify the type of training evaluation used in each scenario. Your choices for each scenario...
Please identify the type of training evaluation used in each scenario. Your choices for each scenario are one of the four types of evaluation: 1. Results Evaluation; 2. Behavioral Evaluation; 3. Learning Evaluation; 4. Reaction Evaluation A. A curator of a traveling new exhibit examines the wear on the new museum floor in the room where the exhibit is located to ascertain the popularity of the exhibit. What level of evaluation is this? B. Rod goes through training on controlling...
There are many sellers of used cars. Each seller has exactly one used car to sell...
There are many sellers of used cars. Each seller has exactly one used car to sell and is characterised by the quality of the used car he wishes to sell. The quality of a used car is indexed by θ, which is uniformly distributed between 0 and 1. If a seller sells his car of quality θ for price p, his utility is p − θ2. If he does not sell his car, his utility is 0. Buyers of used...
Initial Question: The structure of the criminal justice system is designed to have three separate branches:...
Initial Question: The structure of the criminal justice system is designed to have three separate branches: the legislative branch, the executive branch and the judicial branch. Police officers, which fall under the executive branch of the criminal justice system, have the authority to use discretion when interacting with the citizens within the communities in which they serve. Do you think that police abuse their power of discretion or fail to use it? Please explain your answer.
A. Your branch has just started the day’s business and many customers are thronging to get...
A. Your branch has just started the day’s business and many customers are thronging to get banking services. Suddenly the computer system breaks down and the customers and staff are complaining as this problem happens frequently. What should you do? B. Encik Bahari is a long standing customer of your branch. He applied for a housing loan recently and your head office approved the loan at an interest rate of BLR + 2%. Encik Bahari requests for your goodwill as...
Answer BOTH parts of this question: a) There are many wine yeasts and each has its...
Answer BOTH parts of this question: a) There are many wine yeasts and each has its own strengths and weaknesses. Briefly describe TWO (2) ways in which wine yeasts might be genetically modified, by whichever approach, to improve their performance in wine fermentations. b) There are many approaches that can be used to improve the characteristics of a wine yeast. Discuss ONE (1) NON-genetic engineering approach that might be used to create a novel yeast strain and compare the advantages...
1) Smart Driver Driving School has many branches across provinces. In a province different from the...
1) Smart Driver Driving School has many branches across provinces. In a province different from the one in problem 1, the teaching committee at the provincial branch randomly assigned half of their 5000 students enrolled this year to receive the conventional teaching method and the remaining half to receive the new teaching method. In a random sample of 100 students who received the conventional teaching method, 76 passed the road test. In another random sample of 100 students who received...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT