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: 3754190 • 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 $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, your tax is $1,082.5.

PLEASE HELP ME WITH THIS IN JAVA!!

Project: Computing Tax Problem Description 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 $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, your tax is $1,082.5 Table 2009 U.S. Federal Personal Tax Rates Marginal Tax Rate 10% 15% 25% 28% 33% 35% Married Filing Separately Married Filing Jointly or Single Head of Household Qualified Widow(er) SO-$8,350 S8,351 $33,950 S33,951 - $82,250 S82,251-$171,550 SO S16,700 $16,701 S67,900 S67,901 S137,050 S137,051 -$208,850 SO-$8,350 $8,351 -$33,950 S33,951 S68,525 S68,525 -$104,425 $0-$11,950 S11,951 $45,500 S45,501 -$117,450 S117,451 S190,200 S190,201 -$372,950 S372,951+ S171,551 S3 2,950 s208,851-$372950 $104,426 S372,951+ S372,951+ $186,476+ 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 A for single filers, B for married filing jointly, C for married filing separately, and D for head of household Here are sample runs of the program Sample I Enter the filing status: A Enter the taxable income: 100000 Tax is 21720.0 Sample 2 Enter the filing status: B Enter the taxable income:300339 Tax is 76932.87 Sample 3 Enter the filing status: C Enter the taxable income: 123500 Tax is 29665.5 Sample 4 Enter the filing status: D Enter the taxable income: 4545402 Tax is 1565250.7

Explanation / Answer

Program:

import java.io.*;
import java.util.*;

public class Solution {
  
  
public static void main(String[] args) {
//take input
Scanner scanner = new Scanner(System.in);
//filing status
System.out.println("Enter the filing status: ");
char status= scanner.next().charAt(0);
//income
System.out.println("Enter the taxable income: ");
int income= scanner.nextInt();
  
//calculate tax and print
float tax = calculateTax(status,income);
System.out.println("Tax is "+tax);
  
}
  
/*
This function calculates income tax.
status is filing status and income is taxable income
*/
public static float calculateTax(char status,int income){
float tax = 0; ///stores tax
  
if(status=='A'){
if(income>372950){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (82250-33950)*0.25;  
tax += (171550-82250)*0.28;
tax += (372950-171550)*0.33;
tax += (income-372950)*0.35;
}else if(income>171550){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (82250-33950)*0.25;  
tax += (171550-82250)*0.28;
tax += (income-171550)*0.33;
}else if(income>82250){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (82250-33950)*0.25;
tax += (income-82250)*0.28;
}else if(income>33950){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (income-33950)*0.25;
}else if(income>8350){
tax += 8350*0.10;  
tax += (income-8350)*0.15;
}else {
tax += (income)*0.10;
}
return tax;
  
}else if(status=='B'){
if(income>372950){
tax += 16700*0.10;
tax += (67900-16700)*0.15;  
tax += (137050-67900)*0.25;  
tax += (208850-137050)*0.28;
tax += (372950-208850)*0.33;
tax += (income-372950)*0.35;
}else if(income>208850){
tax += 16700*0.10;
tax += (67900-16700)*0.15;  
tax += (137050-67900)*0.25;  
tax += (208850-137050)*0.28;
tax += (income-208850)*0.33;
}else if(income>137050){
tax += 16700*0.10;
tax += (67900-16700)*0.15;  
tax += (137050-67900)*0.25;
tax += (income-137050)*0.28;
}else if(income>67900){
tax += 16700*0.10;
tax += (67900-16700)*0.15;  
tax += (income-67900)*0.25;
}else if(income>16700){
tax += 16700*0.10;  
tax += (income-16700)*0.15;
}else {
tax += (income)*0.10;
}
return tax;
  
}else if(status=='C'){
if(income>186475){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (68525-33950)*0.25;  
tax += (104425-68525)*0.28;
tax += (186475-104425)*0.33;
tax += (income-186475)*0.35;
}else if(income>104425){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (68525-33950)*0.25;  
tax += (104425-68525)*0.28;
tax += (income-104425)*0.33;
}else if(income>68525){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (68525-33950)*0.25;
tax += (income-68525)*0.28;
}else if(income>33950){
tax += 8350*0.10;
tax += (33950-8350)*0.15;  
tax += (income-33950)*0.25;
}else if(income>8350){
tax += 8350*0.10;  
tax += (income-8350)*0.15;
}else {
tax += (income)*0.10;
}
return tax;
  
}else {
if(income>372950){
tax += 11950*0.10;
tax += (45500-11950)*0.15;  
tax += (117450-45500)*0.25;  
tax += (190200-117450)*0.28;
tax += (372950-190200)*0.33;
tax += (income-372950)*0.35;
}else if(income>190200){
tax += 11950*0.10;
tax += (45500-11950)*0.15;  
tax += (117450-45500)*0.25;  
tax += (190200-117450)*0.28;
tax += (income-190200)*0.33;
}else if(income>117450){
tax += 11950*0.10;
tax += (45500-11950)*0.15;  
tax += (117450-45500)*0.25;
tax += (income-117450)*0.28;
}else if(income>45500){
tax += 11950*0.10;
tax += (45500-11950)*0.15;  
tax += (income-45500)*0.25;
}else if(income>11950){
tax += 11950*0.10;  
tax += (income-11950)*0.15;
}else {
tax += (income)*0.10;
}
return tax;
}
}
  
}

Sample output:

1)

2)

3)

4)

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