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


Please Help Members By Posting Answers For Below Questions

what is the purpose of the runtime class?

549


What is return type in java?

628


What is the largest data type in java?

506


How do you declare a string variable?

510


What is the difference between and ?

502






What is the collection interface?

582


What is the default value of local and global variables?

559


What is generic type?

564


Explain the JDB in depth & command line.

565


What is the function of compareto in java?

581


What are peerless components?

616


Do you know how to reverse string in java?

578


Can we define private and protected modifiers for variables in interfaces?

576


Can a class be declared as protected?

529


How strings are created in java?

555