Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please let CodeBreaker solve this question, just solve in java program slove by (object and String and Inheritance and Polymorphism) Palestinian Dairy Factory (Employee Class):

please let CodeBreaker solve this question, just

solve in java program

slove by (object and String and Inheritance and Polymorphism)

Palestinian Dairy Factory

(Employee Class):

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

1 Employee name.

2 Employee Number.

3 Hire date.

4 Address 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, do a class named productionWorker that inherits from the Employee class. The

productionWorker class should have fields to hold the following information:

1 : Shift (an integer)

2 :Hourly pay rate (a double)

3 : Number 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:

1 monthly salary

2 monthly production bonus that a shift supervisor has earned.

3 Number of products that produced by team that he/she supervised.

4 Number 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:

1 Monthly Bonus

2 Required Training Hours

3 Training 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:

1 Hours and payed rate + bonus.

2 calculations of bonus depends on the total training hours

attended by team leader according to the following equation.

Bonus_achieved= Bonus*attended_hours/training_hours

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

Notes :

1:toString method should be implemented in appropriate way in all

Employee sub classes displaying all the information including.

2 :Your program should be test for all bugs and illegal inputs from user.

3 :Create classes separately (Employee.java,ProductionWorker.java,etc)

4 :You 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 setting up 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 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions