Question

Assignment Four (T) Compatiblity Mode 4 Weekly Payroll. Wnite a Java program to create a weekly payroll using the following A
0 0
Add a comment Improve this question Transcribed image text
Answer #1

NOTE
#######

The adjusted weekley income is not correct. Please make correction in that value according to your need

//############################### PGM START ##########################

import java.util.Scanner;

public class EmployeePayroll {
   //function to find tax based on marital status
   public static double findWithheld(double value,String status) {
       double result=0.0;
       if(status.equalsIgnoreCase("m") || status.equalsIgnoreCase("married")) {
           if(value<=124) {
               result=0;
           }else if(value>124 && value<=899) {
               result=(value-124)*0.15;
           }else if(value>899 && value<=1855) {
               result=((value-899)*0.28)+116.25;
           }else if(value>1855 && value<=3084) {
               result=((value-1855)*0.31)+383.93;
           }else if(value>3084 && value<=5439) {
               result=((value-3084)*0.36)+764.92;
           }else {
               result=((value-5439)*0.396)+1612.72;
           }
       }else {
           if(value<=51) {
               result=0;
           }else if(value>51 && value<=517) {
               result=(value-51)*0.15;
           }else if(value>517 && value<=1105) {
               result=((value-517)*0.28)+69.90;
           }else if(value>1105 && value<=2493) {
               result=((value-1105)*0.31)+234.54;
           }else if(value>2493 && value<=5385) {
               result=((value-2493)*0.36)+664.82;
           }else {
               result=((value-5385)*0.396)+1705.94;
           }
       }
       return result;
   }
   //main method
   public static void main(String[] args) {
       int id;
       double hourWage=0.0;
       double hours=0.0;
       int excempt=0;
       String status;
       double earning=0.0;
       double current=0.0;
       double withheld=0.0;
      
       Scanner s=new Scanner(System.in);
      
       System.out.print("Enter the employee id number: ");
       id=Integer.parseInt(s.nextLine());
       while(true) {
           System.out.print("Enter the hourly wage: ");
           hourWage=Double.parseDouble(s.nextLine());
           System.out.print("Enter hours worked: ");
           hours=Double.parseDouble(s.nextLine());
           System.out.print("Enter number of withholding excemption: ");
           excempt=Integer.parseInt(s.nextLine());
           System.out.print("Enter the marital status: ");
           status=s.nextLine();
           System.out.print("Enter previous year to date earning: ");
           earning=Double.parseDouble(s.nextLine());
          
           current=hourWage*hours;
          
           //change the adjusted weekly income(first parameter as it is not giving correct value)
           withheld=findWithheld((current-51.92),status);
           System.out.println("Payroll information");
           System.out.println("Employee id: "+id);
           System.out.println("Current earnings: $"+current);
           System.out.printf("Year to date earnings: $%.2f\n",(current+earning));
           System.out.printf("FICA taxes: $%.2f\n",((0.062*current)+(0.0145*current)));
           System.out.printf("Federal income tax withheld: $%.2f\n",withheld);
           System.out.println("Total home pay check amount: $"+(current-withheld));
          
          
           System.out.print("Enter the employee id number(-1 to end): ");
           id=Integer.parseInt(s.nextLine());
           if(id==-1)
               break;
          
       }
       s.close();
   }

}


//############################# PGM END ####################################

OUTPUT
#########

Problems Javadoc Deciaration Console Coverage terminated> EmployeePayroll [Java Application] C:\Program Files Javaljdk Enter

Add a comment
Know the answer?
Add Answer to:
Assignment Four (T) Compatiblity Mode 4 Weekly Payroll. Wnite a Java program to create a weekly p...
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
  • EI1.11 (LO 3) Ramirez Company has the following data for the weekly payroll ending January 31. Federal Income Tax Withholding $34 37 58 Health Insurance $10 25 25 Hours Hourly Employee L. Helton R...

    EI1.11 (LO 3) Ramirez Company has the following data for the weekly payroll ending January 31. Federal Income Tax Withholding $34 37 58 Health Insurance $10 25 25 Hours Hourly Employee L. Helton R. Kenseth 8 8 8 8 8 2 D. Tavaras 9 10 8 8 9 0 M T W TF S Rate 8 8 9 8 10 3 $12 14 15 Employees are paid 112 times the regular hourly rate for all hours worked in excess of...

  • Lily Company has the following data for the weekly payroll ending January 31. Hours Employee M...

    Lily Company has the following data for the weekly payroll ending January 31. Hours Employee M T W T F S Hourly Rate Federal Income Tax Withholding Health Insurance L. Helton 9 8 8 8 10 2 $12 $35 $11 R. Kenseth 7 9 8 7 7 4 14 37 26 D. Tavaras 9 11 9 9 9 0 15 58 25 Employees are paid 1.5 times the regular hourly rate for all hours worked in excess of 40 hours...

  • EXHIBIT 2 Table for Percentage Method of Withholding WEEKLY Payroll Period Wage Bracket Withholding Table (a)...

    EXHIBIT 2 Table for Percentage Method of Withholding WEEKLY Payroll Period Wage Bracket Withholding Table (a) SINGLE person (including head of household)- If the amount of wages (after subtracting withholding allowances) The amount of income tax IS: Not over $43 Over- But not over- to withhold is: of excess over_ $43 $222 $767 $1,796 $3,700 $7,992 $8,025 $43 $222 . . $0.00 plus 10% -$767 . . $17.90 plus 15% $222 $767-$1,796 . . $99.65 plus 25% McGrath wage bracket...

  • VERSIONBACK Exercise 11-11 Ramirez Company has the following data for the weekly payroll ending January 31...

    VERSIONBACK Exercise 11-11 Ramirez Company has the following data for the weekly payroll ending January 31 Hourly Federal Income Health Employee M T w T F S Rate Tax LHeton 87981| 2 S12 IR,Kenseth 7 9 7 7 84 14 $11 25 uey D. Tavaras 908 95 57 Employees are paid 1.5 times the reguiar hourly rate for all hours worked in excess of 40 houns per week FICA taxes are 7.65% Ramirez Company is subject to S4% state nemployment...

  • Rand Company's payroll on December 31 of the current year is as follows: • total payroll,...

    Rand Company's payroll on December 31 of the current year is as follows: • total payroll, $500,000 • payroll in excess of $128,400 to each employee, $350,000 . payroll in excess of $7,000 to each employee, $400,000 • income taxes withheld, $85,000 • union dues withheld, $10,000 • tax rates: state unemployment tax, 5.4%; FICA tax, 8% for employees and 8% for employers for any amounts over $117,000; federal unemployment tax, 0.6% Required: Prepare the journal entries for Rand's payroll...

  • Calculate Payroll computer programmer, and an administrator. The following payroll information is available for each K....

    Calculate Payroll computer programmer, and an administrator. The following payroll information is available for each K. Mello Company has three employees-a consultant, employee Administrator Consultant Computer Programmer $3,110 per week Regular earnings rate $36 per hour $44 per hour Overtime earnings rate 1.5 times hourly rate Not applicable 2 times hourly rate Federal income tax withheld $930 $244 $510 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay period,...

  • An hourly employee is paid $30/hour for a 40 hour week. Overtime is paid at time-and-a-half...

    An hourly employee is paid $30/hour for a 40 hour week. Overtime is paid at time-and-a-half for hours worked in excess of 40 hours. In the prior week, the employee worked 48 hours. Federal income taxes of $250 were withheld, and state income taxes of $40 were withheld. FICA taxes of 6.2% (Social Security) and 1.45% (Medicare) were also withheld. What is the weekly gross pay amount or this employee? What is the weekly net pay amount for this employee?

  • An employee receives an hourly rate of $14, with time and a half for all hours...

    An employee receives an hourly rate of $14, with time and a half for all hours worked in excess of 40 during a week. Payroll data for the current week are as follows: hours worked, 44; federal income tax withheld, $307; cumulative earnings for year prior to current week, $95,748; social security tax rate, 6.0% on maximum of $105,569; and Medicare tax rate, 1.5% on all earnings. What is the gross pay for the employee? Select the correct answer. a.$644...

  • An employee receives an hourly wage rate of $18, with time and a half for all...

    An employee receives an hourly wage rate of $18, with time and a half for all hours worked in excess of 40 hours during a week. Payroll data for the current week are as follows: hours worked, 45; federal income tax withheld, $304; social security tax rate, 6.0%; and Medicare tax rate, 1.5% on all earnings. What is the gross pay for the employee? Select the correct answer. $810 $1,215 $1,620 $855

  • An employee receives an hourly wage rate of $19, with time and a half for all...

    An employee receives an hourly wage rate of $19, with time and a half for all hours worked in excess of 40 hours during a week. Payroll data for the current week are as follows: hours worked, 43; federal income tax withheld, $324; social security tax rate, 6.0%; and Medicare tax rate, 1.5% on all earnings. What is the gross pay for the employee? Select the correct answer. $846 $1,226 $817 $1,634

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
ADVERTISEMENT