i need income tax program using java inheritance concept.
could u please help me?

Answers were Sorted based on User's Feedback



i need income tax program using java inheritance concept. could u please help me?..

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

i need income tax program using java inheritance concept. could u please help me?..

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

Post New Answer

More Core Java Interview Questions

Is java 9 released?

0 Answers  


what is the diffrences between platform independent and portable

5 Answers   TCS,


What is the vector class in java programming?

0 Answers  


What is an enumeration?

0 Answers  


What are the 6 functions?

0 Answers  


What is a lightweight component?

0 Answers  


What is threaded programming and when is it used? : Java thread

0 Answers  


What are MalformedURLException and UnknownHost Exceptions and whey they will be thrown?

2 Answers  


Where to store local variables?

0 Answers   Aspiring Minds,


What is array list in java?

0 Answers  


What is an object class?

0 Answers  


What is java and why do we need it? Explain

0 Answers  


Categories