Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this should be in JAVA that could be in eclipse or blueJ IDE Problem Description: Design and implement a Worker class, the class diagram is

this should be in JAVA that could be in eclipse or blueJ IDE image text in transcribed
image text in transcribed
Problem Description: Design and implement a Worker class, the class diagram is below. Worker > >> #String lastName, firstName, SSN + double getWeeklySalaryo + boolean equals(Worker w) + String toString + int compareTo(Worker w) Note: the Worker is an abstract class that implements the Comparable interface where workers are compared by their weekly salary, getWeeklySalary() method is an abstract method. In addition to Worker class, there are three different kinds of workers in a company, each of which will be a direct sub-class of Worker. These three classes are listed below: 1. Manager gets paid a fixed amount of salary regardless of how many hours they worked in a week. 2. Salaried Worker gets paid by the hour according to his/her hourly pay rate 3. SalesWorker gets paid a fixed based weekly salary plus a percentage of its sales. Details: You are to write six classes: an implementation of the Worker and implementations for each subclasses; a class named Weekly WorkerDataBase as outline below; a client class Driver that will use test the functionalities of Weekly WorkerDatabase. Methods for class Weekly Worker DataBase: Weekly WorkerDataBase() Constructs a weekly WorkerDatabase object. The data is from system standard input. Managerl getManagers Returns an array of all managers in the database. The length of the array is equal to the number of managers in the database. Salaried Worker|| getSalaried Workers Returns an array of all salaried workers in the database. The length of the array is equal to the number of salaried workers in the database. SalesWorkergetSales Workers Returns an array of all sales workers in the database. The length of the array is equal to the number of sales workers in the database. double getTotal Weekly Salaryo Returns the total amount of weekly salary of all the workers in the database. Worker getWorkerBySSN(String ssn) Returns the worker having the specified social security number. Worker getWorkersMakingMoreThan(double amount) Returns an array of workers making more than the specified amount per week. The length of the array is equal to the number of workers making more than the specified amount per week. Worker getHighestSalary Worker() Returns the worker having the highest weekly salary in the database file. Use the compareTo method. Input Format: Manager:lastName:firstName:SSN:weekly Salary SalesWorker: lastName:firstName:SSN:weekly Base Salary:commissionPercentage:salesAmountFor Week Salaried Worker: lastName:firstName:SSN:hourlyRate:hoursWorkedForWeek Sample Inputs: Manager:Bonds:Barry:123456789:118599.10 Manager:Pujols:Albert:987654321:65330.50 Sales Worker:Sexon:Richie:111222333:50000.00:1.3:34500.30 Salaried Worker:Jenkins:Geoff:444555666:110.00:25 Sales Worker:Sheets:Ben:777888999:30000.25:75:56000.50 Problem Description: Design and implement a Worker class, the class diagram is below. Worker > >> #String lastName, firstName, SSN + double getWeeklySalaryo + boolean equals(Worker w) + String toString + int compareTo(Worker w) Note: the Worker is an abstract class that implements the Comparable interface where workers are compared by their weekly salary, getWeeklySalary() method is an abstract method. In addition to Worker class, there are three different kinds of workers in a company, each of which will be a direct sub-class of Worker. These three classes are listed below: 1. Manager gets paid a fixed amount of salary regardless of how many hours they worked in a week. 2. Salaried Worker gets paid by the hour according to his/her hourly pay rate 3. SalesWorker gets paid a fixed based weekly salary plus a percentage of its sales. Details: You are to write six classes: an implementation of the Worker and implementations for each subclasses; a class named Weekly WorkerDataBase as outline below; a client class Driver that will use test the functionalities of Weekly WorkerDatabase. Methods for class Weekly Worker DataBase: Weekly WorkerDataBase() Constructs a weekly WorkerDatabase object. The data is from system standard input. Managerl getManagers Returns an array of all managers in the database. The length of the array is equal to the number of managers in the database. Salaried Worker|| getSalaried Workers Returns an array of all salaried workers in the database. The length of the array is equal to the number of salaried workers in the database. SalesWorkergetSales Workers Returns an array of all sales workers in the database. The length of the array is equal to the number of sales workers in the database. double getTotal Weekly Salaryo Returns the total amount of weekly salary of all the workers in the database. Worker getWorkerBySSN(String ssn) Returns the worker having the specified social security number. Worker getWorkersMakingMoreThan(double amount) Returns an array of workers making more than the specified amount per week. The length of the array is equal to the number of workers making more than the specified amount per week. Worker getHighestSalary Worker() Returns the worker having the highest weekly salary in the database file. Use the compareTo method. Input Format: Manager:lastName:firstName:SSN:weekly Salary SalesWorker: lastName:firstName:SSN:weekly Base Salary:commissionPercentage:salesAmountFor Week Salaried Worker: lastName:firstName:SSN:hourlyRate:hoursWorkedForWeek Sample Inputs: Manager:Bonds:Barry:123456789:118599.10 Manager:Pujols:Albert:987654321:65330.50 Sales Worker:Sexon:Richie:111222333:50000.00:1.3:34500.30 Salaried Worker:Jenkins:Geoff:444555666:110.00:25 Sales Worker:Sheets:Ben:777888999:30000.25:75:56000.50

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

Step: 3

blur-text-image

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

Students also viewed these Databases questions