-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTax.java
More file actions
47 lines (42 loc) · 1.33 KB
/
Tax.java
File metadata and controls
47 lines (42 loc) · 1.33 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.util.Scanner; // for input object
// DONE
public class Tax {
public static void main(String[] args)
{
Scanner obj = new Scanner(System.in);
double income, tax; // for tax calculation
do // Validation
{
// PROMPT
System.out.println(" Enter only Integer value ");
System.out.print(" Write your Income in Lakhs : ");
income = obj.nextDouble();
System.out.println();
} while (income < 0);
if (income > 10)
{
System.out.println(" TAX = 30%");
income = income * 100000; // 100,000 = 1 LAKH
tax = income * 0.3; // 30%
System.out.println(" Tax need to be paid : " + tax);
}
else if(income >= 5)
{
System.out.println(" TAX = 20%");
income = income * 100000; // 100,000 = 1 LAKH
tax = income * 0.2; // 20%
System.out.println(" Tax need to be paid : " + tax);
}
else if (income >= 2.5)
{
System.out.println(" TAX = 5%");
income = income * 100000; // 100,000 = 1 LAKH
tax = income * 0.05;
System.out.println(" Tax need to be paid : " + tax);
}
else
{
System.out.println(" NO TAX");
}
}
}