Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

What is the history of this situation?

Answered: 1 week ago

Question

Be familiar with the basic ways to manage capacity.

Answered: 1 week ago

Question

Be familiar with the five basic ways to manage demand.

Answered: 1 week ago