Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The United States federal personal income tax is calculated based on filing stat

ID: 3765897 • Letter: T

Question

The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing jointly, married filing separately, and head of household. The tax rates vary every year. Table 1 shows the rates for 2009. If you are, say, single with a taxable income of $10,000, the first $6,000 is taxed at 10% and the other $4,000 is taxed at 15%. So, your tax is $1,200. (Using Java)

Table 1 2009 U.S. Federal Personal Tax Rates

Marginal Tax Rate-Single / Married Filing Jointly or Qualified Widow(er) / Married Filing Separately / Head of Household

10% / $0 – $8,350 / $0 – $16,700 / $0 – $8,350 / $0 – $11,950

15% / $8,351– $33,950 / $16,701 – $67,900 / $8,351 – $33,950 / $11,951 – $45,500

25% / $33,951 – $82,250 / $67,901 – $137,050 / $33,951 – $68,525 / $45,501 – $117,450

28% / $82,251 – $171,550 / $137,051 – $208,850 / $68,525 – $104,425 / $117,451 – $190,200

33% / $171,551 – $372,950 / $208,851 – $372,950 / $104,426 – $186,475 / $190,201 - $372,950

35% / $372,951+ / $372,951+ / $186,476+ / $372,951+

You are to write a program to compute personal income tax. Your program should prompt the user to enter the filing status and taxable income and compute the tax. Enter 0 for single filers, 1 for married filing jointly, 2 for married filing separately, and 3 for head of household.

Here are sample runs of the program:

Sample 1: Enter the filing status: 0 Enter the taxable income: 100000 Tax is 21720.0

Sample 2: Enter the filing status: 1 Enter the taxable income: 300339 Tax is 78777.87

Sample 3: Enter the filing status: 2 Enter the taxable income: 123500 Tax is 29665.5

Sample 4: Enter the filing status: 3 Enter the taxable income: 4545402 Tax is 1565250.7

Explanation / Answer

Answer :

import java.util.Scanner;

public class ComputeTaxProblem {
public static void main(String[] args) {

Scanner input = new Scanner(System.in);

System.out.print("(0-single filer, 1-married jointly, " +
"2-married separately, 3-head of household) " +
"Enter the filing status: ");
int status = input.nextInt();


System.out.print("Enter the taxable income: ");
double income = input.nextDouble();

double tax = 0;
if(status==0){
if (income <= 8350)
tax = income * 0.10;
else if (income <= 33950)
tax = 8350 * 0.10 + (income - 8350) * 0.15;
else if (income <= 82250)
tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +

(income - 33950) * 0.25;
else if (income <= 171550)
tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
(82250 - 33950) * 0.25 + (income - 82250) * 0.28;
else if (income <= 372950)
tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
(82250 - 33950) * 0.25 + (171550 - 82250) * 0.28 +
(income - 171550) * 0.35;
else
tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
(82250 - 33950) * 0.25 + (171550 - 82250) * 0.28 +
(372950 - 171550) * 0.33 + (income - 372950) * 0.35;
}
else if(status==1){
if (income <= 16700)
tax = income * 0.10;
else if (income <= 67900)
tax = 16700* 0.10 + (income - 16700) * 0.15;
else if (income <= 137050)
tax = 16700 * 0.10 + (67900 - 16700) * 0.15 +

(income - 67900) * 0.25;
else if (income <= 208850 )
tax = 16700 * 0.10 + (67900 - 16700) * 0.15 +
(137050 - 67900) * 0.25 + (income -137050 ) * 0.28;
else if (income <= 372950)
tax = 16700 * 0.10 + (67900 - 16700) * 0.15 +
(137050 - 67900) * 0.25 + (208850 - 137050) * 0.28 +
(income - 208850) * 0.35;
else
tax = 16700 * 0.10 + (67900 - 16700) * 0.15 +
(137050- 67900) * 0.25 + (137050- 82250) * 0.28 +
(372950 - 208850) * 0.33 + (income - 372950) * 0.35;
}
System.out.println("Tax is " + (int)(tax)*(100) / 100.0);
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote