-
Notifications
You must be signed in to change notification settings - Fork 39
/
IncomeTax.java
52 lines (49 loc) · 1.08 KB
/
IncomeTax.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
46
47
48
49
50
51
52
import java.io.*;
class t12question5
{
public static void main(String args[])throws IOException
{
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader y = new BufferedReader(in);
int age;String gender; double ti,tax=0.00;
System.out.println(" Enter the age of the customer");
{
age=Integer.parseInt(y.readLine());
}
System.out.println("Enter the gender of the customer");
{
gender=y.readLine();
}
if((age>65)||(gender.equalsIgnoreCase("female")))
{
System.out.println(" wrong category" );
System.exit(0);
}
else
{
System.out.println("Enter taxable income");
{
ti=Double.parseDouble(y.readLine());
}
if(ti<=160000)
{
tax=0.00;
System.out.println("tax = "+tax);
}
else if((ti>160000)&&(ti<=500000))
{
tax=(ti-160000)*0.1;
System.out.println("tax = "+tax);
}
else if((ti>500000)&&(ti<=800000))
{
tax=((ti-500000)*0.2)+34000;
System.out.println("tax = "+tax);
}
else
{
tax=((ti-800000)*0.3)+94000;
System.out.println("tax = "+tax);
}
}
}}