hello i'm new in java and have a problem getting started on a program. which has to follow all of this. Write a Java program to do the following:
Assume that the company has at most 30 employees. Use two parallel arrays. One will be a two—dimensional array —— a row of
this array will hold the number of hours worked, hourly pay rate, gross pay, net pay, federal withholding, state withholding, and
union dues. The second array will be a one—dimensional array of Strings holding the names of the employees. The payroll
information for the ith name from the array of Strings will be in the ith row of the two—dimensional array.
This program should read from a file and write to a file.
Data: Each line will contain a name followed by the number of hours worked and then the pay rate (both real numbers).
Spaces will separate the fields. Gross pay will be calculated as follows:
hours <= 40.0 pay rate is used
40.0 < hours < 50.0 hours above 40.0 and less than 50.0 are paid at one and a half times the pay rate
50.0 <= hours hours above 50.0 are paid at, twice the pay rate.
The Federal withholding tax rate is 18% and the state withholding tax rate is 4.5%. The value for union dues is $7.85. .
Use constants for these and for 30. These may be global
constants — declared before the main method.
Use a method when calculating federal withholding and round the answer to the nearest hundredth. Do state withholding the
same way. Use a method to create a report -— this method will be called after all input and all calculations are done and will
call the 3 methods specified below.
a. A method to print heading information including:
Natural Pine Furniture Company
Payroll Report
and column headings for the name, net pay, gross pay, federal tax, state tax, dues, hours, and pay rate -— in that order.
b. A method to print the detail lines for the employees --matching the headings indicated in a. Single space the
detail lines.
c. A method to print a summary line with the totals for net pay, gross pay, dues, federal tax withholding, and state tax
withholding. (Line should have totals at the bottom of the appropriate columns, or print on separate lines with
messages.) Also, print a line with a message that contains the number of employees processed.
after the report has been printed, sort the employees alphabetically and print out the report again. The sort used
should be a modification of the selection sort handed out. The method specified on page 1 should be used to print out the
report.
Next sort the employees in descending order by gross pay and print out the report again. (Again modifying the selection sort
handed out.) The method specified on page 1 should be used to print out the report.
This program should be written in a nice form and the output should look nice. Use appropriate methods. The main program
should consist of method calls. Use one file for all the source code. Use appropriate parameter passing and no nonlocal
variables.
Minimal documentation will be accepted for this program. Hand in printed copies of your data file, the source code,
and the output.
Data: Form of data is a name, then number of hours (real) and
then pay rate (real) with spaces separating the fields.