# Java Modelling Scenario

• 06-20-2012, 10:57 AM
bond_007
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
• 06-20-2012, 01:04 PM
Tolls
Re: Java Modelling Scenario
(Tolls looks "below" and sees no code.)
• 06-20-2012, 07:24 PM
DarrylBurke
Re: Java Modelling Scenario

db
• 06-20-2012, 07:25 PM
DarrylBurke
Re: Java Modelling Scenario
Quote:

Originally Posted by Tolls
(Tolls looks "below" and sees no code.)

Maybe that's all the 'current work' there is?

db
• 06-21-2012, 12:10 AM
Fubarable
Re: Java Modelling Scenario
That's OK. I've solved the problem and have posted my solution code below.
• 06-06-2016, 01:09 AM
ark
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?
• 06-06-2016, 01:30 AM
jim829
Re: Java Modelling Scenario