Starting from:

$30

Java_BIR Project 3 Solved

Assignment3: (It’s allowed to use Chapters 1-11 only )

Palestinian Dairy Factory

 

Employee Class:

Design a class named Employee . The class should keep the following information in fields:

lEmployee name.

lEmployee Number.

lHire date.

lAddress that composed of (street, state,city,zip code).

Write one or more constructors and the appropriate accessor and mutator methods for the class. This class has isEmpNumberValid method which return boolean data type .

Employee Number in the format XXX–L, where each X is a digit within the range 0–9 and the L is a letter within the range A–M

ProductionWorker Class:

Next, write a class named productionWorker that inherits from the Employee class. The productionWorker class should have fields to hold the following information:

lShift (an integer)

lHourly pay rate (a double)

lNumber of hours per month

The workday is divided into two shifts:day and night. The shift field will be an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. getTotalSalary() method should calculate the total salary based on the following:

Day shift worker should at least works 8 hours with rate per hour, and for any extra hours he/she get 1.25 hours instead of it, but night shift have to work at least 7 hours and for any extra hours he/she get 1.5 hours instead of it. Day shifts has only one value, 1 or 2 and others not allowed. Calculation of salary should be per month.(let month has 26 days/work).

Write one or more constructors and the appropriate accessor and mutator methods for the class.

ShiftSupervisor Class:

In this factory, a shift supervisor is an employee whose supervises a shift. In addition to a basic salary, the shift supervisor earns a monthly bonus when his or her shift meets production goals (set this value by program user). Design a ShiftSupervisor class that inherits from the Employee class you created above. The ShiftSupervisor class should have a field that holds the following information:

lmonthly salary

lmonthly production bonus that a shift supervisor has earned.

lNumber of products that produced by team that he/she supervised. lNumber of products must produced under his/her supervision.

getTotalSalary() method should calculate the total salary based on the following: If shift

supervisor employee teams produce the required number of products or more, the he/she can earn the monthly bonus. Write one or more constructors and the appropriate accessor and mutator methods for the class.

TeamLeader Class:

In this factory, a team leader is production worker who leads a small team. In addition to hourly pay, team leaders earn a fixed monthly bonus (read from user). Team leaders are required to attend a minimum number of hours of training per month.

The TeamLeader class should have a field that holds the following information:

lMonthly Bonus

lRequired Training Hours

lTraining Hours Attended

Design a TeamLeader class that inherits from the ProductionWorker class you designed. getTotalSalary() method should calculate the total salary based on the following:

l  Hours and payed rate + bonus.

l  calculations of bonus depends on the total training hours attended by team leader according to the following equation. Bonus_achieved= Bonus*training _hours/attended_hours

Write one or more constructors and the appropriate accessor and mutator methods for the class.

Notes :

ltoString method should be implemented in appropriate way in all Employee sub classes displaying all the information including.

lYour program should be test for all bugs and illegal inputs from user.

lCreate classes separately (Employee.java,ProductionWorker.java,etc) lYou should decide the data types for every data members in classes

Competitive Part : You have to guess other methods,at least one different method for any class from above program.(These methods should be YOURS and not shared with others , every new unique creative method will get +3 marks as bonus ).This method should do something creative (calculation) , not accessor and mutator.

Class Driver for Palestinian Dairy Factory:

1.      Draw UML for this factory ( consider all notations, private, public, protected, final, for modifiers and methods, and relations like like inheritance and aggregations) .

You can use any tools that may helps in class diagram, covert to pdf format and attache it . I recommend to use free tool form https://www.diagrams.net/

2.      You should create a Test class that has an Arraylist of different Employee types, then call a method that will list all employee info who is greater than average of all employees.

public static void ListGreaterThanAverage(ArrayList<Employee> list)

{ .... }

Note: Array List should have at least 2 types from every subclass (fill the array list manually).You don’t need to create scanner to read from console Set of instructions:

1.Create folder at your desktop with your Assignment#, ID, and your name Example:A3_1190100_AliMohammad

2. Create a new project using Eclipse IDE and store your project inside this folder.

3.Zipped this folder and submit it by your ITC account [under meta course ].

More products