top of page
`Calculate PayrollWrite a program that can be used to calculate a worker’s expected wages, deductions and net pay based upon the hours worked and pay rate, both entered by the user.The following percentages are to be used as constants in your program for calculation of withholdings:• Federal tax withholding rate: 15%• State tax withholding rate: 4%• City tax withholding rate: 2%• Social Security tax rate: 6.2%• Medicare tax rate: 1.45%You may declare any additional variables as neededFor this assignment, you are to write six (6) methods, in addition to your main method, as itemized below.1. Write a method that will allow the user to input the number of hours worked OR their pay rate as separate individual calls to this method. Since both of these values are of type double, you should be able to write one method to accommodate both data items with the only thing changing in each case being the query to the user (“Enter Hours Worked: ” or “Enter Pay Rate: “). This method will contain a loop structure that will iterate until proper input is achieved (data validation). When finished, you should have a generic method that returns a double and can be used throughout your work whenever you need a method to return a validated double. I would suggest that you write similar methods for other data types. You will find this useful in the future. The header of this method should look something like:private static double GetDoubleAmount(String prompt) prompt = question to the user2. Write a method that calculates and returns their total pay by multiplying the hours worked times their pay rate.3. Write a single method that can be used to calculate and return each deduction individually. For instance, this method will be able to calculate both federal OR state taxes by changing only the values sent to the formal parameters via arguments. From this, you will see the true value of methods.4. Write a method to output pay:Hours Worked: 41.25Pay Rate: 20.00Pay:Gross Pay 825.005. Write a method to output deductions:Deductions:Federal Tax 123.75State Tax 33.00City Tax 16.50Social Sec 51.15Medicare + 11.96-------Total Deductions 236.366. Write a method to output net pay:Net Pay 588.64All together, your output will be:Enter Hours Worked: 41.25Enter Pay Rate: 20Hours Worked: 41.25Pay Rate: 20.00Pay:Gross Pay 825.00Deductions:Federal Tax 123.75State Tax 33.00City Tax 16.50Social Sec 51.15Medicare + 11.96-------Total Deductions 236.36Net Pay 588.64BONUS CHALLENGE: (20 points) Modify the above requirement to incorporate overtime pay for hours worked over 40 hours. The overtime rate will be 1.5 times their pay rate for those hours worked over 40. Below are 2 runs of this program, one with hours > 40 (overtime accounted for) and one with hours <= 40:Enter Hours Worked: 41Enter Pay Rate: 20Hours Worked: 41.00Pay Rate: 20.00Pay:Regular Pay: 800.00OT Pay + 30.00-------Gross Pay 830.00Deductions:Federal Tax 124.50State Tax 33.20City Tax 16.60Social Sec 51.46Medicare + 12.04-------Total Deductions 237.80Net Pay 592.20Enter Hours Worked: 40Enter Pay Rate: 20Hours Worked: 40.00Pay Rate: 20.00Pay:Gross Pay 800.00Deductions:Federal Tax 120.00State Tax 32.00City Tax 16.00Social Sec 49.60Medicare + 11.60-------Total Deductions 229.20Net Pay 570.80Once you are completed, save the source code file (.java). Don't forget to put the following information in your submitted file as code comments: Your name Project NameDate Description of Program Developed and Compiled using // Doug Streitenberger // Chapter 5 Programming Assignment // Today’s Date // This program... // Developed and compiled using NetBeans Finally, click on the link to attach the completed .java file. When you have finished attaching your solution, don't forget to press the SUBMIT button.`

# Payroll Java Assignment

\$40.00Price
• File includes Assignment and Complete Java executable Code.

bottom of page