-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtax.java
More file actions
25 lines (19 loc) · 671 Bytes
/
tax.java
File metadata and controls
25 lines (19 loc) · 671 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
import java.util.Scanner;
public class tax{
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
float income,tax=0;
System.out.println("Enter your income in lakhs:");
income=sc.nextFloat();
sc.close();
if(income<2.5f)
tax= tax+0;
else if(income>2.5f && income<5f)
tax=tax+ (income-2.5f)*.05f;
else if(income>5.0f && income<=10.0f)
tax= tax + (income-5f)*.2f;
else if(income>10.0f)
tax=tax+ (income-10f)*.3f;
System.out.println("Tax to be paid is "+ tax+"lakhs");
}
}