i need income tax program using java inheritance concept.
could u please help me?
Answer Posted / pratima
import java.util.Scanner;
public class Main087
{
public static void main(String[] args)
{
float income,tax,surchrg;
System.out.print("Enter Income of person : ");
Scanner scan=new Scanner(System.in);
income=scan.nextFloat();
if (income<=50000.)
tax=0;
else if (income<=100000.00)
tax=(income-50000.00F)*10/100;
else if (income<=250000.00)
tax=(income-100000.00F)*20/100+5000;
else
tax=(income-250000.00F)*30/100+5000+30000;
if (tax>10000.00)
surchrg=tax*2/100;
else
surchrg=0;
System.out.printf("Income = %f
",income);
System.out.printf("TAX = %f
",tax);
System.out.printf("Surcharge = %f
",surchrg);
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is anonymous inner class?
Explain the inheritance?
What do you mean by collectors in java 8?
Mention a package that is used for linked list class in java.
Explain about sets?
How many digits is int32?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
What is string pool in java?
In java, how we can disallow serialization of variables?
What is the difference between actual and formal parameters?
Is null a string or object in java?
What is meant by polymorphism?
Explain the difference between extends thread vs implements runnable in java?
What is a platform?
What is difference between array and vector?