-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRS.java
87 lines (78 loc) · 2.19 KB
/
IRS.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* Write a description of class IRS here.
*
* @author Luke Bradaric
* @version (a version number or a date)
*/
public class IRS
{
int SorM;
double taxInc;
double fedTax;
public IRS(){}
public IRS(int singleOrMarried, double taxableIncome)
{
SorM = singleOrMarried;
taxInc = taxableIncome;
runTax();
}
public void newV(int singleOrM, double taxableIncome)
{
SorM = singleOrM;
taxInc = taxableIncome;
runTax();
}
private void runTax()
{
if (SorM == 1)
{
if (taxInc > 0 && taxInc < 27050)
{
fedTax = taxInc * .15;
}
else if (taxInc > 27050 && taxInc < 65550)
{
fedTax = 4057.50 + (taxInc * .275);
}
else if (taxInc > 65550 && taxInc < 136750)
{
fedTax = 14645 + (taxInc * .305);
}
else if (taxInc > 136750 && taxInc < 297350)
{
fedTax = 36361 + (taxInc * .355);
}
else if (taxInc > 297350)
{
fedTax = 93374 + (taxInc * .391);
}
System.out.println("Single");
}
if (SorM == 2)
{
if (taxInc > 0 && taxInc < 45200)
{
fedTax = taxInc * .15;
}
else if (taxInc > 45200 && taxInc < 109250)
{
fedTax = 6780 + (taxInc * .275);
}
else if (taxInc > 109250 && taxInc < 166500)
{
fedTax = 24393.75 + (taxInc * .305);
}
else if (taxInc > 166500 && taxInc < 297350)
{
fedTax = 41855 + (taxInc * .355);
}
else if (taxInc > 297350)
{
fedTax = 88306 + (taxInc * .391);
}
System.out.println("Married");
}
System.out.println("Taxable Income: " + taxInc);
System.out.println("Federal Tax: " + fedTax);
}
}