Design a Windows Desktop application and write the code that will execute accord
ID: 3797872 • Letter: D
Question
Design a Windows Desktop application and write the code that will execute according to the program requirements in Figure 4-108. Before designing the user interface, create a Use Case Definition. Before writing the code, create an event-planning document for each event in the program. REQUIREMENTS DOCUMENT Date: January 4, 2016 Date Submitted: Application Title: Income Tax Calculator Purpose: This Windows Desktop application will compute and display the FICA tax, federal tax, and state tax for one year based on your income. Program Procedures: From a window on the screen, the user enters her yearly income. The program estimates the Program FICA tax, federal tax, and state tax for one year based on the user's income. Algorithms, Processing, and Conditions: Users must be able to enter their annual income. The FICA tax (7.65%), federal tax (22%), and state income tax (3%) are computed. The tax amounts should be displayed on separate lines and in currency format, two places past the decimal points. The net pay should be displayed after the tax amounts have been deducted. Notes and Restrictions: The user can clear the income and taxes and then enter new data. The user can use an Exit button to close the application. Comments: The designer should design the user interface, including all graphics and words displayed.Explanation / Answer
System.out.println("Enter your Gross Pay: ");
double pay = input.nextDouble();
double gross_pay = pay * 1;
System.out.println("Enter federal tax withholding rate: ");
double fedtax = input.nextDouble();
double fedtaxr = gross_pay * 0.15;
System.out.println("Enter state tax withholding rate: ");
double statetax = input.nextDouble();
double statetaxr = gross_pay * 0.035;
System.out.println("Enter Social Security tax withholding rate: ");
double socialtax = input.nextDouble();
double socialtaxr = gross_pay * 0.0575;
System.out.println("Enter Medicare/Medicaid tax withholding rate:");
double medicaretax = input.nextDouble();
double medicaretaxr = gross_pay * 0.0275;
System.out.println("Enter Pension Plan tax withholding rate:");
double pensiontax = input.nextDouble();
double pensiontaxr = gross_pay * 0.05;
System.out.println("Enter Health Insurance tax withholding rate:");
double healthtax = input.nextDouble();
double healthtaxr = gross_pay - 75.0 ;
double deductions = fedtaxr + statetaxr + socialtaxr + medicaretaxr +
pensiontaxr + healthtaxr;
double total_pay = gross_pay - deductions;
System.out.println("Employee name: " + employee);
System.out.println(" Enter gross pay: " + gross_pay);
System.out.println(" Deductions: ");
System.out.println(" Federdal Withholding (15.0%): $ " + fedtaxr);
System.out.println(" State Withholding (3.5% ): $ " + statetaxr);
System.out.println(" Social Security Tax (5.75%): $ " + socialtaxr);
System.out.println(" Medicare Tax (2.75%): $ " + medicaretaxr);
System.out.println(" Pension Plan (5%): $ " + pensiontaxr);
System.out.println(" Health Insurance ($75.00): $ " + healthtaxr);
System.out.println(" Total deductions: $ " + deductions);
System.out.println("Total pay: " + total_pay);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.