Question
Model the following in a Java program: In a software engineering project we are developing software for an automobile production plant. We have the following
Model the following in a Java program:
In a software engineering project we are developing software for an automobile production plant. We have the following users in the system: Worker and Manager. Each of these is a user and every user has name, surname, username, password and address. The worker can be AutoWorker, TruckWorker or BusWorker. The manager can be AutoManager. TruckManager or BusManager. Model these in an inheritance model considering that: 1. Worker has these fields in addition to user: SSN, WagePerHour, Bonus, HoursOfWork, Salary. 2. AutoWorker has a field in addition to Worker: NumbeOfAutosCompleted 3. TruckWorker has a field in addition to Worker: NumberOfPartsCompleted 4. BusWorker has a field in addition to Worker: NumberOfComponentsMounted 5. All workers have their salary calculated based on the respective fields: WagePerHour and hoursOfWork. 6. Manager has these fields in addition to user: SSN, WagePerHour, Bonus, HoursOfWork, Salary. NumberOfWorkerSupervised, NumberOfTeams, Bonus 7. AutoManager has these fields in addition to manager: NumbeOfAutosCompleted. Bonus is computed based on this formula: NumbeOfAutosCompleted x 100. 8. TruckManager has these fields in addition to manager: NumbeOfTrucksCompleted and NumberofPartsCompleted: Bonus is computed based on this formula: NumbeOfTrucksCompleted x 100 + NumberofPartsCompleted x 50. 9. BusManager has these fields in addition to manager: NumbeOfBusesCompleted and NumberofComponentsMounted: Bonus is computed based on this formula: NumbeOfBusesCompleted x 100 + NumberofComponentsMounted x 50. Develop these methods: 1. Two overloaded constructors for all workers and all managers, one with just name and surname and one with all the fields as parameters. 2. computeBonus( ) and computeSalary( ) for all workers and managers. 3. toString( ) method for each class. 4. Write a class to test the program: a. Create two users for each type by using the appropriate constructors. b. Put the users in two separate data structures of Java that you have learned, one for the workers and one for the managers. c. Print the information of all the users that are stored in the data structure.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started