-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathch2_2.java
More file actions
62 lines (61 loc) · 1.05 KB
/
Copy pathch2_2.java
File metadata and controls
62 lines (61 loc) · 1.05 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
import java.util.Scanner;
public class ch2_2
{
public static void main(String[] args)
{
System.out.print("请输入个人收入:");
Scanner input=new Scanner(System.in);
double sr=input.nextDouble();
System.out.println("应交个人所得税:"+getTax(sr));
}
public static double getTax(double sal)
{
double t=0;
double b =sal-3500;
if(b <=500)//25
{
t=b*0.05;
return t;
}
else if(b <=2000)//175
{
t=25+(b-500)*0.1;
return t;
}
else if(b <=5000)//625
{
t=175+(b-2000)*0.15;
return t;
}
else if(b <=20000)//3625
{
t=625+(b-5000)*0.2;
return t;
}
else if(b <=40000)//8625
{
t=3625+(b-20000)*0.25;
return t;
}
else if(b <=60000)//14625
{
t=8625+(b-40000)*0.3;
return t;
}
else if(b <=80000)//21625
{
t=14625+(b-60000)*0.35;
return t;
}
else if(b <=100000)//29625
{
t=21625+(b-80000)*0.4;
return t;
}
else
{
t=29625+(b-100000)*0.45;
return t;
}
}
}