The tax department has announced the new tax rated and deductions as per the following
rules:
Tax rates
Annual income (in Rs.)
Upto - 175000
Nil
next 175000
next 175000
10% of exceeding annual income
20% of exceeding annual income
30% of exceeding annual income
above 550001
Write a java program to input employee id, employee name and monthly income.
Compute the annual income and tax to be paid using the above criteria. Print employee
id, employee name, annual income, and tax amount.
Please Answer it's very Urgent!
Answers
Answer:
Using scanner class...
Explanation:
import java.util.Scanner;
class Income
{
public static void main(String args[])
{
double tax=0,it;
Scanner sc=new Scanner(System.in);
System.out.println("Enter income ");
it=sc.nextDouble();
if(it<=200000)
tax=0;
else if(it<=300000)
tax=0.1*(it-200000);
else if(it<=500000)
tax=(0.2*(it-300000))+(0.1*100000);
else if(it<=1000000)
tax=(0.3*(it-500000))+(0.2*200000)+(0.1*100000);
else
tax=(0.4*(it-1000000))+(0.3*500000)+(0.2*200000)+(0.1*100000);
System.out.println("Income tax amount is "+tax);
}
}
2 using static method..
import java.util.Scanner;
class Income
{
public static void main(String args[])
{
double t=0;
Scanner sc=new Scanner(System.in);
System.out.println("Enter income ");
double i=sc.nextDouble();
t=incomeTax(i);
System.out.println("Income tax amount is "+t);
}
static double incomeTax(double i)
{
double tax;
if(i<=200000)
tax=0;
else if(i<=300000)
tax=0.1*(i-200000);
else if(i<=500000)
tax=(0.2*(i-300000))+10000;
else if(i<=1000000)
tax=(0.3*(i-500000))+50000;
else
tax=(0.4*(i-1000000))+200000;
return tax;
}
}
3- using command line arguments...
class Income
{
public static void main(String arg[])
{
double tax=0,it;
it=Double.parseDouble(arg[0]);
System.out.println("Annual Income is : "+it);
if(it<=200000)
tax=0;
else if(it<=300000)
tax=0.1*(it-200000);
else if(it<=500000)
tax=(0.2*(it-300000))+(0.1*100000);
else if(it<=1000000)
tax=(0.3*(it-500000))+(0.2*200000)+(0.1*100000);
else
tax=(0.4*(it-1000000))+(0.3*500000)+(0.2*200000)+(0.1*100000);
System.out.println("Income tax amount is "+tax);
}
}
YOU CAN USE ANY OF THE THREE METHODS..
Answer:
3 meters tall saxophones set every year to commemorate Europe music festival in Dinant,Belgium