i need income tax program using java inheritance concept.
could u please help me?
Answers were Sorted based on User's Feedback
Answer / jitendra kumar
i think you must be use heirarchi inheritance.
but best option is interface because it provide same feature
of multiple inheritance.In java, we can not use multiple
inheritance
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / 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 |
What is boolean example?
What is an object in Java and what are its benefits?
What are virtual methods?
What is thin driver and thick driver. why it is called so?
In how many ways we can do exception handling in java?
What is the difference between a vector & an array list?
What is run-time class and system class? what is their purpose?
What is the immediate superclass of the Dialog class?
what is the swingutilities.invokelater(runnable) method for? : Java thread
What is Marker interface in java? and what is clone?
Define class?
What is the difference between class & structure?