Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. EmployeeDatabase: a list of all the employees and supervisors of the company as well as helpful methods. The type should only have a constructor

image text in transcribed

7. EmployeeDatabase: a list of all the employees and supervisors of the company as well as helpful methods. The type should only have a constructor that takes an int that is the maximum number of people that can be in the database and creates an empty array or arrays of an appropriate size to store the employees and supervisors. The type should have the following features that you will need to turn into onc or more methods of the samc, or slightly modificd, names, as appropriate 1. add: thc add method(s) lets you add an employcc or a supcrvisor object to the databasc. The object added should be the parameter to the mcthod. The method should throw an EmployeeDatabaseFull exception if there are already the maximum number of allowed employees in the database. (You throw an exception using the throw Java command.) 2. remove(first name, last name, number) lets you remove an employee or a supervisor that matches the parameters first name, last name, and number. The object removed from the database should be returned by the method. A NoSuchEmployee exception should be thrown if no employce or supcrvisor matching the given name and number is in the databasc 3. find(first name, last name, number) returns an employee or a supervisor object that matches the parameters first name, last name, and number. Throws a NoSuchEmployee exception if no employee or supervisor matching the parameter values exists in the database 4. getPayrollAmount: returns the total amount that all employees and supervisors earned 5. getMaximumEarned: returns the employee or the supervisor who has the largest earnings in the database (break ties arbitrarily). Returns null if there are no emploces or supervisors in the 6. getMinimumEarned: returns the employee or the supervisor who has the least earnings in the database (break ties arbitrarily). Returns null if there are no emploees or supervisors in the 7. getMaxSales: returns the employee or the supervisor who has the largest number of sales (break ties arbitrarily). Throws a NoSuchEmployee exception if there are no sales employees or sales 8. getMinSales: returns the employcc or the supervisor who has the least number of sales (break ties arbitrarily). Throws a NoSuchEmployee exception if there are no sales employces or sales 9. getMaxHoursWorked: returns the employee or the supervisor who worked the most hours (break ties arbitrarily). Throws a NosuehEmployee exception if there are no hourly employees or 10. getMinHours Worked: returns the employee or the supervisor who worked the fewest hours (break ties arbitrarily). Throws a NoSuchEmployee exception if there are no hourly employees or 11. getSupervisees(supervisor): takes a supervisor object as input and returns an array that contains all the employee and supervisor objects that the parameter supervisor supervises. (The order of supervisors in the database supervisors in the database hourly supervisors in the database hourly supervisors in the database the objects in the array docs not matter, but the length of the array should cqual the total number of supervisces.) 7. EmployeeDatabase: a list of all the employees and supervisors of the company as well as helpful methods. The type should only have a constructor that takes an int that is the maximum number of people that can be in the database and creates an empty array or arrays of an appropriate size to store the employees and supervisors. The type should have the following features that you will need to turn into onc or more methods of the samc, or slightly modificd, names, as appropriate 1. add: thc add method(s) lets you add an employcc or a supcrvisor object to the databasc. The object added should be the parameter to the mcthod. The method should throw an EmployeeDatabaseFull exception if there are already the maximum number of allowed employees in the database. (You throw an exception using the throw Java command.) 2. remove(first name, last name, number) lets you remove an employee or a supervisor that matches the parameters first name, last name, and number. The object removed from the database should be returned by the method. A NoSuchEmployee exception should be thrown if no employce or supcrvisor matching the given name and number is in the databasc 3. find(first name, last name, number) returns an employee or a supervisor object that matches the parameters first name, last name, and number. Throws a NoSuchEmployee exception if no employee or supervisor matching the parameter values exists in the database 4. getPayrollAmount: returns the total amount that all employees and supervisors earned 5. getMaximumEarned: returns the employee or the supervisor who has the largest earnings in the database (break ties arbitrarily). Returns null if there are no emploces or supervisors in the 6. getMinimumEarned: returns the employee or the supervisor who has the least earnings in the database (break ties arbitrarily). Returns null if there are no emploees or supervisors in the 7. getMaxSales: returns the employee or the supervisor who has the largest number of sales (break ties arbitrarily). Throws a NoSuchEmployee exception if there are no sales employees or sales 8. getMinSales: returns the employcc or the supervisor who has the least number of sales (break ties arbitrarily). Throws a NoSuchEmployee exception if there are no sales employces or sales 9. getMaxHoursWorked: returns the employee or the supervisor who worked the most hours (break ties arbitrarily). Throws a NosuehEmployee exception if there are no hourly employees or 10. getMinHours Worked: returns the employee or the supervisor who worked the fewest hours (break ties arbitrarily). Throws a NoSuchEmployee exception if there are no hourly employees or 11. getSupervisees(supervisor): takes a supervisor object as input and returns an array that contains all the employee and supervisor objects that the parameter supervisor supervises. (The order of supervisors in the database supervisors in the database hourly supervisors in the database hourly supervisors in the database the objects in the array docs not matter, but the length of the array should cqual the total number of supervisces.)

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

What is a cost allocation rate? How is it measured?

Answered: 1 week ago