{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Program Assignment #11

# Program Assignment #11 - CS 1050 Dr Tucker Prog Assign#11...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 1050, Dr. Tucker Prog. Assign. #11, p.1 of 2 Spring 2010 Apr 6/7 Due: Friday, May 7 Number of points: 150 accepted until 4:30 pm on Fri, May 14 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 withhold'nw tax rate is 4.5%. The value for union dues is \$7.85. 9‘ 7 .Mi.. if These may be global constan s — 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. CS 1050, Dr. Tucker Prog. Assign. #11, p 2 of 2 Spring 2010 Apr 6/7 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 print out the report again. handed out.) print out the report. This program should be written in a nice form and the output should look nice. Use appropriate methods. should consist of method calls. code. the employees in descending order by gross pay and (Again modifying the selection sort The method specified on page 1 should be used to The main program Use one file for all the source 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, Hancock John Light Karen L Fagan Bert Todd Antrim Forrest N Camden Warren Mulicka Al B Lee Phoebe Bright Harry Garris Ted Benson Martyne Lloyd Jeanine D Leslie Bennie A Brandt Leslie Schulman David Worthington Dan Hall Gus W Prigeon Dale R Fitzgibbons Rusty Feistner Merle S Hallquist Dottie Bolton Seth Taylor Gregg Raskin Rose Kenwood Pat Slaugher Lew then number of hours (real) and then pay rate (real) with spaces separating the fields. 40. 40. .000 60. 36. 52. 49. 25. 41. 43. .900 .000 58. .000 40. .500 50. 43. 40. 23. 43. .000 43. 40. .333 41 39 41 41 80 43 43 000 000 000 500 333 750 000 000 000 500 100 100 000 000 000 333 000 100 7. 7. 7. 9. 10.75 9. 11.50 .50 .50 .00 .00 .50 .50 .50 .25 (XJWOQQKOQGJONCD 75 00 00 25 05 ...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Program Assignment #11 - CS 1050 Dr Tucker Prog Assign#11...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online