Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Intro to Java Programming Challenge: You are creating a program that calculates

ID: 3725467 • Letter: I

Question

Intro to Java Programming Challenge:

You are creating a program that calculates Illinois withholding taxes based on automated payroll method. The number of allowances will determine the amount of taxes to withhold. Allowances are 06, use a switch statement to setup tax processing algorithm allowances. If taxes withheld are more than 549.99 you should output to screen “Lotta Money you work hard”. If taxes withheld are less than 50 you should output to screen “Going poor you need to work harder”. If taxes withheld are between than 49.99 and 250 you should output to screen “Thank you for being a good provider”. If taxes withheld are more than 249.99 and less than 550 you should output to screen “Thank you for being a great provider”. Convert Payroll data types from double to float. Input: Use Joptionpane for all input data. LastName FirstName DaysWorkedPerWeek HoursWorkedPerDay WeeksInPayPeriod numberOfAllowances payRatePerHour Processing: Illinois Taxes withheld using automated payroll method www.revenue.state.il.us/taxforms/withholding/il700t.pdf taxAmount: netPay equals grossPay minus (Illinois withholding Automated payroll method pg. 4) Arithmetic expressions to prepare desired output. Output: formatted output to console using Printf FirstName&LastName, Days Worked and pay periods within the year. Projected Gross Pay, Net Pay and tax amount per day Projected Gross Pay, Net Pay and tax amount per week Projected Gross Pay, Net Pay and tax amount per quarter Projected Gross Pay, Net Pay and tax amount per pay period Projected Gross Pay, Net Pay and tax amount per year

Explanation / Answer

Programming part is completed as per requirement, document you have provided has multiple methods of tax calculation so check if calculated tax is what you've expected, otherwise change it as it is simple maths, coding part is provides here....comment on answer if there is problem in understanding the code..although all the code is pretty strightforward as names are used as it is for variables

*************************code*************************************************

import javax.swing.*;
public class Tax {

   /**
   * @param args
   */
   public static void main(String[] args) {
       // TODO Auto-generated method stub

    String lastName=JOptionPane.showInputDialog("Enter Last Name");
       String firstName=JOptionPane.showInputDialog("Enter First Name");
    String daysWorkedPerWeek=JOptionPane.showInputDialog("Enter Days worked per week");
       String hoursWorkedPerWeek=JOptionPane.showInputDialog("Enter Hours worked per week");
    String weeksInPayPeriod=JOptionPane.showInputDialog("Enter Weeks in pay period");
       String numberOfAllowances=JOptionPane.showInputDialog("Enter No. of allowances");
    String payRatePerHour=JOptionPane.showInputDialog("Enter Pay rate per hour");
    float hrs_per_week=Float.valueOf(hoursWorkedPerWeek);
    float pay_rate_per_hr=Float.valueOf(payRatePerHour);
    float wages_paid=hrs_per_week*pay_rate_per_hr;
       //double tax_withheld=0;
    float num_of_allowances=Float.valueOf(numberOfAllowances);
    float calc_line1=num_of_allowances*2000;
    float calc_line2=num_of_allowances*1000;
    float sum=calc_line1+calc_line2;
    //System.out.println(wages_paid);
     float tax_withheld=(0.495f)*(wages_paid-(sum/52.0f));
     float net_pay=wages_paid-tax_withheld;
     System.out.printf("First Name:%s   Last Name:%s ",firstName, lastName);
     //System.out.println();
     System.out.printf(" days worked in week:%s", daysWorkedPerWeek);
     System.out.printf(" Pay period within year is 52 weeks");
     System.out.printf(" Projected gross pay:%f", wages_paid);
     System.out.printf(" Net Pay:%f", net_pay);
     System.out.printf(" Net Pay:%f   tax amount per day:%f ",net_pay/7.0f, tax_withheld/7.0f);

    //double wages_paid=
       if(tax_withheld>549.99)
       {
           System.out.println(" Lotta Money you work hard");
       }
       else if(tax_withheld<50)
       {
           System.out.println(" Going poor you need to work harder");
       }
       else if(tax_withheld>49.99 && tax_withheld<250)
       {
           System.out.println(" Thank you for being a good provider");
       }
       else if(tax_withheld>249.99 && tax_withheld<550)
       {
           System.out.println(" Thank you for being a great provider");
       }


   }

}

************************************************************************************************

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote