-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThree1.java
More file actions
72 lines (64 loc) · 2.06 KB
/
Three1.java
File metadata and controls
72 lines (64 loc) · 2.06 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import java.util.Scanner;
class Three1
{
public static void main(String[] Strings)
{
Scanner input = new Scanner(System.in);
int num;
double Gross_Pay;
double Net_Pay;
double Tax;
System.out.println("\tGross Pay\t\t\tTax Rate\n\t1)Over 40,000\t\t\t30%\n\t2)>=30,000 but below 40,000\t25%\n\t3)>=20,000 but below 30,000\t15%\n\t4)>=10,000 but below 20,000\t10%\n\t5)Below 10,000\t\t\t no tax.");
System.out.print("Enter num:");
num = input.nextInt();
if(num == 1)
{
System.out.print("Enter Gross Pay:");
Gross_Pay = input.nextDouble();
Tax = 0.3 * Gross_Pay;
System.out.println("Tax = " + Tax);
Net_Pay = Gross_Pay - Tax;
System.out.println("Net Pay = " + Net_Pay);
}
else if(num == 2)
{
System.out.print("Enter Gross Pay:");
Gross_Pay = input.nextDouble();
Tax = 0.25 * Gross_Pay;
System.out.println("Tax = " + Tax);
Net_Pay = Gross_Pay - Tax;
System.out.println("Net Pay = " + Net_Pay);
}
else if(num == 3)
{
System.out.print("Enter Gross Pay:");
Gross_Pay = input.nextDouble();
Tax = 0.15 * Gross_Pay;
System.out.println("Tax = " + Tax);
Net_Pay = Gross_Pay - Tax;
System.out.println("Net Pay = " + Net_Pay);
}
else if(num == 4)
{
System.out.print("Enter Gross Pay:");
Gross_Pay = input.nextDouble();
Tax = 0.1 * Gross_Pay;
System.out.println("Tax = " + Tax);
Net_Pay = Gross_Pay - Tax;
System.out.println("Net Pay = " + Net_Pay);
}
else if(num == 5)
{
System.out.print("Enter Gross Pay:");
Gross_Pay = input.nextDouble();
Tax = 0.0 * Gross_Pay;
System.out.println("Tax = " + Tax);
Net_Pay = Gross_Pay - Tax;
System.out.println("Net Pay = " + Net_Pay);
}
else
{
System.out.println("Invalid num!!");
}
}
}