-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFreeResponsePractice.java
More file actions
48 lines (41 loc) · 1.12 KB
/
FreeResponsePractice.java
File metadata and controls
48 lines (41 loc) · 1.12 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
48
import java.util.Scanner;
public class FreeResponsePractice
{
public static void main ( String[] args )
{
Scanner scan = new Scanner(System.in);
double yearly_income, total_paid, subtract_lasttotal, percent;
System.out.println("insert yearly income");
yearly_income = scan.nextDouble();
if (yearly_income<15000)
{
total_paid=yearly_income*0;
}
else if ((15000<yearly_income) && (yearly_income<35000));
{
subtract_lasttotal=yearly_income-15000;
total_paid=subtract_lasttotal*.1;
}
if ((35000<yearly_income) && (yearly_income<65000))
{
subtract_lasttotal=yearly_income-35000;
total_paid=(subtract_lasttotal*.16)+2000;
}
else if ((65000<yearly_income) && (yearly_income<105000))
{
subtract_lasttotal=yearly_income-65000;
total_paid=(subtract_lasttotal*.19)+6800;
}
else if (yearly_income>105000)
{
subtract_lasttotal=yearly_income-105000;
total_paid=(subtract_lasttotal*.22)+14400;
}
else {
System.out.println("No taxes for you");
}
percent= (total_paid/yearly_income)*100;
System.out.println("Total Paid:" + total_paid);
System.out.println( percent + "% of " + yearly_income);
}
}