-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIncome TAx.java
More file actions
26 lines (25 loc) · 848 Bytes
/
Income TAx.java
File metadata and controls
26 lines (25 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.Scanner;
public class Income TAx {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter your income in Lakhs per annum");
float tax = 0;
float income = sc.nextFloat();
if(income<=2.5){
tax = tax + 0;
}
else if(income>2.5f && income <= 5f){
tax = tax + 0.05f * (income - 2.5f);
}
else if(income>5f && income <= 10.0f){
tax = tax + 0.05f * (5.0f - 2.5f);
tax = tax + 0.2f * (income - 5f);
}
else if(income>10.0f){
tax = tax + 0.05f * (5.0f - 2.5f);
tax = tax + 0.2f * (10.0f - 5f);
tax = tax + 0.3f * (income - 10.0f);
}
System.out.println("The total tax paid by the employee is: " + tax);
}
}