Question

## Given below is a hypothetical table showing rates of Income Tax for male citizens below the age of 65 years:

```				```
Taxable Income (TI)           Income Tax
< 1,60,000                       Nil
>1,60,000 and <= 5,00,000     ( TI – 1,60,000 ) * 10%
> 5,00,000 and <= 8,00,000    [(TI – 5,00,000 ) *20%] + 34,000
> 8,00,000                    [(TI – 8,00,000 ) *30% ] + 94,000

```
```

# Share code with your friends

Code

```				```
import java.util.Scanner;

public class program5
{
public static void main(String[] args)
{
int age=0;
double tax=0,income=0;
String gender="";
Scanner sc = new Scanner(System.in);
System.out.print("Enter age: ");
age = sc.nextInt();
System.out.print("Enter gender: ");
gender = sc.next();
System.out.print("Enter taxable income: ");
income = sc.nextDouble();
if (age > 65 || gender.equals("female"))
{
System.out.println("Wrong category");
}
else
{

if (income <= 160000)
{
tax = 0;
}
else if(income > 160000 && income <= 500000)
{
tax = (income - 160000) * 10 / 100;
}
else if(income > 500000 && income <= 800000)
{
tax = (income - 500000) * 20 / 100 + 34000;
}
else
{
tax = (income - 800000) * 30 / 100 + 94000;
}
System.out.println("Income tax is " + tax);
}
}
}

```
```

Sale

50
Sale

150
Sale

200
Sale

50
Sale

50
Sale

50
Sale

50
Sale

50
Sale

50