Question
Need help for a Flowchart for the following : Financial application: Payroll /* * To change this license header, choose License Headers in Project Properties.
Need help for a Flowchart for the following : Financial application: Payroll
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package payroll;
/** * * @author krisd */import java.util.Scanner; public class payroll{ public static void main(String[] args){ Scanner input; input = new Scanner(System.in); // prompt user for name System.out.print("Enter employee's name:"); String name = input.nextLine(); // prompt user for hours worked System.out.print("Enter number of hors worked in a week:"); double hours = input.nextDouble(); // prompt user for hourly rate System.out.print("Enter hourly pay rate:"); double rate = input.nextDouble(); // prompt user for federal tax System.out.print("Enter federal tax withholding rate:"); double ftax = input.nextDouble(); // prompt user for state tax System.out.print("Enter state tax withholding rate;"); double stax = input.nextDouble(); //Display results System.out.println("Employee Name:" + name); System.out.println("Hours Worked:" + hours); System.out.printf("Pay Rate: $%.2fn", rate); System.out.printf("Gross Pay: $%.2fn", rate * hours); System.out.println("Deduction:"); System.out.printf(" Federal Witholding (%.1f%%): $%.2fn", ftax * 100, ftax * rate * hours); System.out.printf(" State withholding (%.1f%%): $%.2fn", stax * 100, stax * rate * hours); System.out.printf(" Total Deduction: $%.2fn", (stax + ftax) * rate * hours); System.out.printf("Net Pay: $%.2fn", (1 - stax - ftax) * rate * hours); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started