MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / IncomeTax_Calculate

Class IncomeTax_Calculate

Programs/IncomeTaxCalculator.java:5–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3*/
4import java.util.Scanner;
5public class IncomeTax_Calculate{
6 public static void main(String[] args) {
7
8 Scanner sc=new Scanner(System.in);
9 System.out.println("Enter your income in lakhs par annum: ");
10 float tax=0;
11 float income=sc.nextFloat();
12 if (income<=2.5) {
13 tax = tax + 0;
14 }
15 else if (income>5f && income<=10.0f) {
16 tax=tax+0.05f*(5.0f-2.5f);
17 tax=tax+0.2f*(income-5f);
18 }else if (income>10.0f) {
19 tax=tax+0.05f*(5.0f-2.5f);
20 tax=tax+0.2f*(10.0f-5f);
21 tax=tax+0.3f*(income-10.0f);
22 }
23 System.out.println("The total tax paid by the employee is : "+tax);
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected