Write a Payroll class that includes the following private instance fields: employeeID: an array of 1

Write a Payroll class that includes the following private instance fields: employeeID: an array of 10 int variables to hold employee identification numbers for 10employees. This array must be initialized at the moment of declaration using the following numbers:

900567929 900578929 900878029 900172937 90057864

900269791 900538623 900853014 900472133 90016228 names: an array of 10 String objects to hold employee names for 10 employees. hours: an array of 10 int variables tohold the number of hours worked by each employee for 10 employees. payRates: an array of 10 double variables to hold the hourly pay rate of each employee for 10employees.

This class should relate the data in each of the above 4 arrays through the subscripts. This Payroll class also includes the following methods:

constructor taking no parameter: It first displays the following information, where … is the employee ID of the corresponding employee:

There are 10 employees in this class (before sorting): employee 1: … employee 2: … ……

Then it sorts the employeeID array using ArrayTools.selectionSort, and displays the above information again while replacing “before sorting” with “after sorting”.Finally, it sets each of the elements in the names array as NULL, each of the elements in the hours array as 0, each of the elements in the payRates array as 0.0.displayEmployeeData: it takes no parameter but displays the following information for all employees

Here is the information on employee 1: Employee ID: …

Name: … Hours worked: … Pay Rate: …

Here is the information on employee 2: Employee ID: …

Name: … Hours worked: … Pay Rate: …

…… getNumbeOfEmployees: it takes no parameter but returns the length of the employeeID array. getEmployeeID: it takes one int parameter as the subscript of theelement to be retrieved within the employeeID array and returns the corresponding employee identification. setEmployeeData: it takes one int parameter as the subscriptof the element to be set within each array, one String parameter as the contents to be set to the corresponding element in the names array, one parameter as the valueto be set to the corresponding element in the hours array, and one double parameter as the value to be set to the corresponding element in the payRates array.calAverageWage: it takes no parameter but returns the average wage of 10 employees as a double. The wage of each employee = his/her hours worked * his/her pay rate;the average wage = sum of 10 wages/10. getHighestWage: it takes no parameter but returns the highest wage among 10 wages as a double. getMinMaxPayRates: it takes noparameter but returns a double array with two elements, the first one recording the lowest pay rate among ten employees and the second one recording the highest payrate. getWageViaIDSeqS: it takes one int parameter as the employee ID and use the sequential search algorithm to search for the employee record with the given ID, thencalculate the wage of the employee with the given ID, and return it as a double. If the record is NOT found, return -1.0.

getWageViaIDBinS: it takes one int parameter as the employee ID and use ArrayTools.binarySearch to search for the employee record with the given ID, then calculate thewage of the employee with the given ID, and return it as a double. If the record is NOT found, return -1.0. getNamesWagesViaIDs: it takes three parameters: an intarray recording the employee IDs, a double array reference to return the wages of the given employees in the same order as that of the int array, and a String arrayreference to return the names of the given employees in the same order as that of the int array. If the record of any given ID is NOT found, use -1.0 as the wage andNULL as the name. The easiest way is to use ArrayTools.binarySearch to search for the employee record corresponding to each ID.

Write a PayrollDemo class that implements the following requirements: Create a Payroll object. Display the employee data of this Payroll object. Get the number ofemployees in this object, use a loop to display the employee ID of each employee and ask the user to enter hours worked and pay rate for this employee, save hoursworked and pay rate to this Payroll object.

Display the employee data of this Payroll object again. Get and display the average wage of all employees with appropriate prompt. Get and display the highest wageamong all employees with appropriate prompt. Get and display the range of the pay rate of all employees with appropriate prompt, e.g., … between … and … Ask theuser to enter an employee ID and display the wage of this employee or “This employee is not found” if there is no such employee ID on record. getWageViaIDSeqS must becalled here. Ask the user to enter another employee ID and display the wage of this employee or “This employee is not found” if there is no such employee ID on record.getWageViaIDBinS must be called here. Ask the user to enter the number of employees that she/he would like to query, validate the user input, which needs to be between1 and the number of employees. Then use this number to as the array size to create three equal-sized arrays: an int array, a double array, and a String array. Use aloop to ask for the IDs of the employees to be queried. Call the getNamesWagesViaIDs method to get the names and wages of the employees queried by the user. Finally,display the following information for each employee queried.

Employee ID: … Name: … Wage: .

"Is this question part of your assignment? We can help"

ORDER NOW