-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtax.java
45 lines (44 loc) · 883 Bytes
/
tax.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
42
43
44
45
import java.io.*;
import java.util.*;
public class tax
{
public static void main(String[] args)
{
try
{
int i;
float j;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the income");
i=sc.nextInt();
if(i<=0)
{
System.out.println("Enter the valid income");
}
if(i<=150000)
{
j=0;
System.out.println("Tax:"+j);
}
if(i>150000&&i<=300000)
{
j=i*10/100;
System.out.println("Tax:"+j);
}
if(i>300000&&i<=500000)
{
j=i*20/100;
System.out.println("Tax:"+j);
}
if(i>500000)
{
j=i*30/100;
System.out.println("Tax:"+j);
}
}
catch(Exception e)
{
System.out.println("Enter the valid income");
}
}
}