1. Member
Join Date
Jun 2012
Posts
1
Rep Power
0

## Java Modelling Scenario

Hi Guys,

I need to solve the small modelling problem
Can you please help. I have started a bit not sure if it is right or needs further modification
kindly, help me

Problem:
Write a series of model classes that represent the following scenario.

A company has a number employees. Every Employee has a Name, an unique Staff Number, Date of Birth, Join Date and Department, Salary.

A Manager is an employee with the following extra information Bonus and Company Car. Bonus is derived from the numbers of whole years (January to December) multiplied by the 1.5% of his salary with a ceiling of 12 years.

A Cleaner is an employee, who also need to store if Day, Morning or Evening shift worker. Also a materiels allowance, this derived as follows, Day shift has 0, Morning has 20 and Evening has 50.

A Driver is an Employee, who has a company car.

A Developer is an Employee has a bonus like the Manager, but he gets 0.75% of every year he works, but no ceiling. Also they store a collection of Programming languages they proficient in. They must have at least one language. Also they have a project code (4 digit number 1000-9999)

An Tester, is an Employee, who has project Code (4 digit number 1000-9999).

An Automated Tester is an Developer who must have at least 2 Programming Languages and one of them must be “Java”. The bonus system is the same with the exception they get 1.25 % per year.

My current work is attached below

2. Moderator
Join Date
Apr 2009
Posts
13,220
Rep Power
23

## Re: Java Modelling Scenario

(Tolls looks "below" and sees no code.)

db

4. ## Re: Java Modelling Scenario

Originally Posted by Tolls
(Tolls looks "below" and sees no code.)
Maybe that's all the 'current work' there is?

db

5. ## Re: Java Modelling Scenario

That's OK. I've solved the problem and have posted my solution code below.

6. Senior Member
Join Date
Apr 2015
Posts
222
Rep Power
2

## Re: Java Modelling Scenario

I have similar question. If i have different departments with different workers. What type of relationship do they have? Is it "Has-a"? For example workers has its department and its department is initialized in constructor by: Department depname; => depname=new Department ("depn"); do it means that different workers can have the same department? Could it have reverse Has-a relationship that Department can have the field with collection of workers? And one more question. Are there relationships except has-a, is-a- f.i. use-a as it seems I was referred for such one once?

7. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,839
Rep Power
10

## Re: Java Modelling Scenario

Regards,
Jim

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•