-
Notifications
You must be signed in to change notification settings - Fork 0
/
TaxSaver.java
44 lines (37 loc) 路 2.22 KB
/
TaxSaver.java
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
import java.util.Scanner;
public class TaxSaver {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println(
"|---------------------------------------------------------------------------------------------------|");
System.out.println(
"| !! TAX SAVER !! |");
System.out.println(
"|---------------------------------------------------------------------------------------------------|");
System.out.print("| * Enter your tax income -> ");
double taxIncome = scan.nextDouble();
System.out.print("| * Enter the investment amount for Equity Linked Saving Scheme (ELSS) -> ");
double investmentELSS = scan.nextDouble();
System.out.print("| * Enter the investment amount for Public Provident Fund (PPF) -> ");
double investmentPPF = scan.nextDouble();
System.out.print("| * Enter the investment amount for National Pension Scheme (NPS) -> ");
double investmentNPS = scan.nextDouble();
System.out.print("| * Enter the investment amount for Home Loan Principal Repayment -> ");
double investmentHomeLoan = scan.nextDouble();
double totalInvestment = investmentELSS + investmentPPF + investmentNPS + investmentHomeLoan;
double taxableIncome = taxIncome - totalInvestment;
double tax = taxableIncome * 0.3;
System.out.println(
"|---------------------------------------------------------------------------------------------------|");
System.out.println(
"| * Your taxable income after investing in various funds, schemes, and loans is -> " + taxableIncome
+ " Rs");
System.out.println("| * Your tax after investing in various funds, schemes, and loans is -> " + tax
+ " Rs");
System.out.println(
"| * You have saved " + (taxIncome - tax) / taxIncome * 100
+ "% tax");
System.out.println(
"|---------------------------------------------------------------------------------------------------|");
}
}