-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPayrollApplication.java
41 lines (24 loc) · 1.03 KB
/
PayrollApplication.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner;
public class PayrollApplication {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//prompt user to enter details
System.out.print("Enter employee's name: ");
String name = input.nextLine();
System.out.print("Enter number of hours worked in a week: ");
double hours = input.nextDouble();
System.out.print("Enter hourly pay rate: ");
double payRate = input.nextDouble();
System.out.print("Enter federal tax withholding rate: ");
double federalTax = input.nextDouble();
System.out.print("Enter state tax withholding rate: ");
double stateTax = input.nextDouble();
//calculate the payments
double grossPay = hours * payRate;
double federal = (0.2 * grossPay);
double state = (0.09 * grossPay);
double totalDeductions = sum(federal, state);
double netPay = (grossPay - totalDeductions);
System.out.printf();
}
}