Income Tax Program
Progressive Slab Tax Calculator:
import java.util.Scanner;
public class IncomeTaxCalculator {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter Annual Taxable Income: ₹");
double income = in.nextDouble();
double tax = 0.0;
// Progressive Tax Slabs:
// Up to ₹2,50,000 : Nil (0%)
// ₹2,50,001 to ₹5,00,000 : 5% of income exceeding ₹2,50,000
// ₹5,00,001 to ₹10,00,000 : ₹12,500 + 20% of income exceeding ₹5,00,000
// Above ₹10,00,000 : ₹1,12,500 + 30% of income exceeding ₹10,00,000
if (income <= 250000) {
tax = 0.0;
} else if (income <= 500000) {
tax = (income - 250000) * 0.05;
} else if (income <= 1000000) {
tax = 12500 + (income - 500000) * 0.20;
} else {
tax = 112500 + (income - 1000000) * 0.30;
}
double cess = tax * 0.04; // 4% Health and Education Cess
double totalTax = tax + cess;
System.out.println("Income Tax Payable : ₹" + tax);
System.out.println("Education Cess (4%) : ₹" + cess);
System.out.println("Total Tax Liability : ₹" + totalTax);
}
}