-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtax.java
More file actions
56 lines (45 loc) · 2.14 KB
/
Copy pathtax.java
File metadata and controls
56 lines (45 loc) · 2.14 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
import java.util.Scanner;
public class tax {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
/*a gift is a transfer of property to another person against no compensation or payment.
If the total value of the gifts you receive from the same donor in the course of 3 years
is €5,000 or more, you must pay gift tax.
When a gift is given by a close relative or family member, the amount of gift tax is determined
by the following table.
VALUE OF GIFT TAX AT THE LOWER LIMIT TAX RATE(%) EXCEEDING PART
5000-25000 100 8
25000-55000 1700 10
55000-200000 4700 12
200000-1000000 22100 15
1000000- 142100 17
For example 6000€ gift implies (100 + (6000-5000)*0.08) and that is 180€ of gift tax.
Write a program that calculates the gift tax for a gift from a close relative or a family member.
*/
System.out.println("Value of gift?");
int num = Integer.valueOf(scanner.nextLine());
double tax1 = 100 + (num - 5000)* 0.08;
double tax2 = 1700 + (num - 25000)* 0.1;
double tax3 = 4700 + (num - 55000)* 0.12;
double tax4 = 22100 + (num - 200000)* 0.15;
double tax5 = 142100 + (num - 1000000)* 0.17;
if (num < 5000){
System.out.println("No tax!");
}
else if (num >= 5000 && num <= 25000) {
System.out.println("Tax: "+tax1);
}
else if (num > 25000 && num <=55000){
System.out.println("Tax:"+tax2);
}
else if (num > 55000 && num <= 200000) {
System.out.println("Tax:"+tax3);
}
else if (num > 200000 && num <= 1000000) {
System.out.println("Tax:"+tax4);
}
else if (num > 1000000) {
System.out.println("Tax:"+tax5);
}
}
}