Write a program to input the name age and taxable income of person .if age is more than 60 years then display the message wrong category
Answers
import java.util.*;
public class Tax
{
public static void main (String args [])
{
Scanner in = new Scanner (System.in);
int b,c;
String a , g ;
System.out.println(" enter your name:");
a = in.nextLine();
System.out.println(" enter your age:");
b = in.nextInt();
System.out.println("enter your gender (male or female) :");
g = in.nextLine();
System.out.println(" enter your taxable income:");
c = in.nextInt();
if (b > 65)
{
System.out.println("Wrong Category !");
}
else if (c <= 250000)
{
System.out.println(" Nil ");
}
else if (c > 250000 && c <= 500000)
{
c = ((c - 160000)* 10/100);
System.out.println(" Payable tax = Rs" +c);
}
else if (c> 500000 && c<= 1000000)
{
c = ((c-500000) * 20/100 + 34000);
System.out.println( "Payable tax = Rs" +c);
}
else if (c> 1000000)
{
c = ((c- 1000000) * 30/100 + 94000);
System.out.println(" Payable tax = Rs" +c);
}
}
}