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

byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p?

7 Answers   NIIT, Wipro,


what are different ways in which a thread can enter the waiting state? : Java thread

0 Answers  


Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).

0 Answers  


What is are packages?

0 Answers  


Differentiate between vector and array list.

0 Answers  






What are Advatages of Overloading and Overridding.

8 Answers   TCS, Wipro,


What's the difference between comparison done by equals method and == operator?

0 Answers  


What is Overriding and how can it be used?

7 Answers   Consagous, Wipro,


What is the reason behind using constructors and destructors?

0 Answers   HCL,


Why do we need autoboxing in java?

0 Answers  


Is it safe to install java on my computer?

0 Answers  


What is the difference between a static and a non-static inner class in java programming?

0 Answers  


Categories