Question

In Java compute pay check net pay for all pay periods with federal and state tax...

In Java compute pay check net pay for all pay periods with federal and state tax (26 in total pay periods), include overtime - number of hours worked over 80 hours. Calculate overtime by : overTimePay = regularPay * 1.5

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

import java.util.Scanner;

class Main {

public static void main(String[] args)

{

double payRate,regularPay,overtimePay,federalTax,stateTax,netPay,taxAmount; // variable declaration

int hours,regularHours=80,payPeriods=26; // variable declaration

Scanner sc =new Scanner(System.in); // Scanner class declaration

System.out.print("Enter number of hours worked: ");

hours = sc.nextInt(); // Accept hours worked

System.out.println("Enter pay rate: ");

payRate = sc.nextDouble(); // Accept payyRate

System.out.println("Enter Federal Tax: ");

federalTax = sc.nextDouble(); // Accept federal tax

System.out.println("Enter State Tax: ");

stateTax = sc.nextDouble(); // Accept state tax

if(hours<=80){ // Find net Pay0

taxAmount = payRate * (federalTax+stateTax)/100;

netPay = 26 *(hours * payRate -taxAmount); // calculate net pay

}


else{ // Find net Pay0

taxAmount = (80 * payRate + (hours-80) * payRate * 1.5 )* (federalTax+stateTax)/100;

netPay = 26*(80 * payRate + (hours-80) * payRate * 1.5 -taxAmount); // calculate net pay for all periods

}

System.out.println("Toatal pay for all periods: "+netPay);

}

}

Output:

Open JDK Runtime Environment (build 10.0.2+13-Ubuntu-lubuntu 0.1A .04.4) > javac -classpath .:/run dir/junit-4.12.jar -d. Mai

Add a comment
Know the answer?
Add Answer to:
In Java compute pay check net pay for all pay periods with federal and state tax...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Introduction to computer class, Java programming through eclipse: Ue the following criteria to create the code:...

    Introduction to computer class, Java programming through eclipse: Ue the following criteria to create the code: SALARY Input first and last name - Output the names last, first in your output - Make the federal withholding rate a constant 20% (not an input value) No state tax Generate two new values: regular pay and overtime pay - 40 hours workedor less - Regular pay is pay rate * hours worked - Overtime pay is 0 Otherwise - Regular pay is...

  • Mike Dooley's regular hourly wage is $16 an hour. He receives overtime pay at the rate...

    Mike Dooley's regular hourly wage is $16 an hour. He receives overtime pay at the rate of time and a half. The FICA tax rate is 7.65%. Mike is paid weekly. For the first pay period in January, Mike worked 49 hours. All hours over 40 earn the overtime rate. Mike's federal income tax withholding is $150 and his state income tax withholding is $60. Mike has authorized that $25 be withheld from his check each pay period for savings...

  • 1. Total net pay, $16.592.58 Excel PR 11-4B Payroll register OBJ. 2,3 The following data for...

    1. Total net pay, $16.592.58 Excel PR 11-4B Payroll register OBJ. 2,3 The following data for Flexco Inc. relate to the payroll for the week ended December, 2016 Hours Hourly Weekly Federal Retirement Employee Worked Rate Salary Income Tax Savings Carlton 52 $50.00 $667.00 $ 60 Grove $4,000 860.00 100 Johnson 36 52.00 355.68 Koufax 58.00 578.55 Maddux 45.00 349.65 Seaver 3,200 768.00 Spahn 52.00 382.20 0 Winn 75 48 50.00 572.00 54.00 43 480.60 0 46 80 Young Employees...

  • Must be written in java. Modularize the following code. //CIS 183 Lab 4 //Joseph Yousef import...

    Must be written in java. Modularize the following code. //CIS 183 Lab 4 //Joseph Yousef import java.util.*; public class SalaryCalc { public static void main(String [] args) { Scanner input = new Scanner(System.in); int sentinelValue = 1; //initializes sentinelValue value to 1 to be used in while loop while (sentinelValue == 1) { System.out.println("Enter 1 to enter employee, or enter 2 to end process: ");    sentinelValue = input.nextInt(); input.nextLine(); System.out.println("enter employee name: "); String employeeName = input.nextLine(); System.out.println("enter day...

  • Complete the following payroll register for Thorndike Manufacturing Company. All workers receive time and one-half for...

    Complete the following payroll register for Thorndike Manufacturing Company. All workers receive time and one-half for hours worked in excess of 40 hours per week. Compute Social Security using 6.2% and Medicare using 1.45%. Medical insurance and union dues deductions are shown in the payroll register. Use the wage bracket method to determine federal income tax. Total each column and verify the total net pay amount. Payroll Register Earnings Deductions Employee Name Allow. Status Hours Worked Pay Rate Regular Overtime...

  • Complete the following payroll register for Thorndike Manufacturing Company. All workers receive time and one-half for...

    Complete the following payroll register for Thorndike Manufacturing Company. All workers receive time and one-half for hours worked in excess of 40 hours per week. Compute Social Security using 6.2% and Medicare using 1.45%. Medical insurance and union dues deductions are shown in the payroll register. Use the wage bracket method to determine federal income tax. Total each column and verify the total net pay amount. Payroll Register Earnings Deductions Employee Name Allow. Status Hours Worked Pay Rate Regular Overtime...

  • PLEASE CORRECT PART (b). COLUMNS (total) and (Net Pay). PLEASE FIX THE HIGHLIGHTED IN [RED]. Lily...

    PLEASE CORRECT PART (b). COLUMNS (total) and (Net Pay). PLEASE FIX THE HIGHLIGHTED IN [RED]. Lily Company has the following data for the weekly payroll ending January 31. Hours Employee MTWTFS Hourly Rate Federal Income Tax Withholding Health Insurance L. Helton 9 8 8 8 10 2 $12 $35 $11 R. 7 9 8 7 7 4 Kenseth 14 37 26 D. 911 9990 15 Tavaras 58 25 Employees are paid 1.5 times the regular hourly rate for all hours...

  • Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The...

    Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...

  • QS 11-12A Net pay and tax computations LO P5 The payroll records of Speedy Software show...

    QS 11-12A Net pay and tax computations LO P5 The payroll records of Speedy Software show the following information about Marsha Gottschalk, an employee, for the weekly pay period ending September 30, 2017. Gottschalk is single and claims one allowance. Compute her Social Security tax (6,2%), Medicare tax (1.45%), federal income tax withholding, state income tax (1.0%), and net pay for the current pay period. (Use the withholding table in Exhibit 11A.6) (Round your final answers to 2 decimal places.)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT