Question

Java Programming Basic and Clean Approach, Please post the answer in Text Format. Computing Tax Problem...

Java Programming

Basic and Clean Approach, Please post the answer in Text Format.

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 3.2 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 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 76932.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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the Java program

=====================================================================================

import java.util.Scanner;


public class TaxCalculator {

    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        System.out.print("Enter the filing status: ");
        int fillingStatus = scanner.nextInt();
        System.out.print("Enter the taxable income: ");
        double income = scanner.nextDouble();
        switch (fillingStatus) {

            case 0:
                singleFillingStatus(income);
                break;
            case 1:
                marriedFillingStatus(income);
                break;
            case 2:
                marriedSeperateFillingStatus(income);
            case 4:
                headFillingStatus(income);
                break;
            default:
                System.out.println("Invalid filling status selected");
                break;
        }


    }

    public static void singleFillingStatus(double income) {
        double tax = 0;
        if (income <= 8350) {
            tax = income * 0.1;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=8350*.1;
            income = income - 8350;
        }
        if (0 <= income && income <= 33950) {
            tax += income * 0.15;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=33950*.15;
            income = income - 33950;
        }
        if (0 <= income && income <= 82250) {
            tax += income * 0.25;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=82250*.25;
            income -= 82250;
        }
        if (0 <= income && income <= 171550) {
            tax += income * 0.28;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=171550*.28;
            income -= 171550;
        }
        if (0 <= income && income <= 372950) {
            tax += income * 0.33;
            System.out.println("Tax is $" + tax);
            return;
        }else{
            tax+=372950*.33;
            income=income-372950;
            tax+=income*0.35;
        }
        System.out.println("Tax is $" + tax);
        return;

    }

    public static void marriedFillingStatus(double income) {
        double tax = 0;
        if (income <= 16700) {
            tax = income * 0.1;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=16700*.1;
            income = income - 16700;
        }
        if (0 <= income && income <= 67900) {
            tax += income * 0.15;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=67900*.15;
            income = income - 67900;
        }
        if (0 <= income && income <= 137050) {
            tax += income * 0.25;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=137050*.25;
            income -= 137050;
        }
        if (0 <= income && income <= 208850) {
            tax += income * 0.28;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=208850*.28;
            income -= 208850;
        }
        if (0 <= income && income <= 372950) {
            tax += income * 0.33;
            System.out.println("Tax is $" + tax);
            return;
        }else{
            tax+=372950*.33;
            income=income-372950;
            tax+=income*0.35;
        }
        System.out.println("Tax is $" + tax);
        return;


    }

    public static void marriedSeperateFillingStatus(double income) {
        double tax = 0;
        if (income <= 8350) {
            tax = income * 0.1;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=8350*.1;
            income = income - 8350;
        }
        if (0 <= income && income <= 33950) {
            tax += income * 0.15;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=33950*.15;
            income = income - 33950;
        }
        if (0 <= income && income <= 68525) {
            tax += income * 0.25;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=68525*.25;
            income -= 68525;
        }
        if (0 <= income && income <= 104425) {
            tax += income * 0.28;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=104425*.28;
            income -= 104425;
        }
        if (0 <= income && income <= 186475) {
            tax += income * 0.33;
            System.out.println("Tax is $" + tax);
            return;
        }else{
            tax+=186475*.33;
            income=income-186475;
            tax+=income*0.35;
        }
        System.out.println("Tax is $" + tax);
        return;


    }

    public static void headFillingStatus(double income) {
        double tax = 0;
        if (income <= 11950) {
            tax = income * 0.1;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=11950*.1;
            income = income - 11950;
        }
        if (0 <= income && income <= 45500) {
            tax += income * 0.15;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=45500*.15;
            income = income - 45500;
        }
        if (0 <= income && income <= 117450) {
            tax += income * 0.25;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=117450*.25;
            income -= 117450;
        }
        if (0 <= income && income <= 190200) {
            tax += income * 0.28;
            System.out.println("Tax is $" + tax);
            return;
        } else {
            tax+=190200*.28;
            income -= 190200;
        }
        if (0 <= income && income <= 372950) {
            tax += income * 0.33;
            System.out.println("Tax is $" + tax);
            return;
        }else{
            tax+=372950*.33;
            income=income-372950;
            tax+=income*0.35;
        }
        System.out.println("Tax is $" + tax);
        return;

    }
}
Add a comment
Know the answer?
Add Answer to:
Java Programming Basic and Clean Approach, Please post the answer in Text Format. Computing Tax Problem...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I have already done the source code I just need help in the analysis part and design part asap Thank you File Edit View...

    I have already done the source code I just need help in the analysis part and design part asap Thank you File Edit View Windew Help ⑦ A Sign In Home Tools IT109N Assigmenx d share By completing this assignment, students should be able to: Assign expressions to variables Perfarm arithrietic calculations using Java Implement console user input/output in their programs . Use If clse statements to control the flow of logic in a program Computing Tax The United States...

  • Use the table to answer the questions. In relation to taxes, Ramone will be filing as...

    Use the table to answer the questions. In relation to taxes, Ramone will be filing as married filing jointly. Ramone is making $156,141.00 this year as an employee of Rust-Eze; he has no other income. Do not consider any deduct this question Married filing jointly or Tax rate Single Married filing separately Head of household qualified widow(er) 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 2593 $33,951-$82,250 $67,901-$137,050 $33,951-$68,525 845,501-$117,450 2856 $82,251-$171,550 $137,051-$208,850 $68,526...

  • import java.util.*; //Include the needed package public class IncomeTax //Class { public static void main(String[] arg...

    import java.util.*; //Include the needed package public class IncomeTax //Class { public static void main(String[] args) { Scanner scInput = new Scanner(System.in); //Create new instance    System.out.println("\nEnter the filing status"); //Prompt for input System.out.println("\0 for filling as single. "); System.out.println("\1 for filling as married jointly. "); System.out.println("\2 for filling as married separately. "); System.out.println("\3 for filling as head of household. "); int filingStatus = scInput.nextInt(); System.out.println("Enter the taxable income:"); double ti = scInput.nextDouble(); double it = 00.00; if(filingStatus==0) { if (ti<=8350)...

  • Marginal (Taxable income] Tax Rate Single Married Filing Jointly 10% $0-$8,350 $0-$16,700 15% $8,350-$33,950 16,700-$67,900 25%...

    Marginal (Taxable income] Tax Rate Single Married Filing Jointly 10% $0-$8,350 $0-$16,700 15% $8,350-$33,950 16,700-$67,900 25% $33,950-$82,250 $67,900-$137,050 28% $82,250-$171,550 $137,050-$208,850 33% $171,550-$372,950 $208,850-$372,950 35% > $372,950 > $372,950 Above is a chart showing the Federal Income Tax Rates for Single and Married couples. How much would a SINGLE INDIVIDUAL pay in taxes if they made $150,000 in income? $42,000 $17,375 $35,720 $25,000 $36,275

  • Answer the following questions related to tax changes for the 2019 and 2020 calendar/tax year. 1....

    Answer the following questions related to tax changes for the 2019 and 2020 calendar/tax year. 1. While the marginal tax rates didn't change in 2019, the amount of income taxed at those tax rates changed. For the following situations, enter the range of income taxed at the rate given: a. Single taxpayer, 22%. b. Married filing jointly, 22%. c. Head of household, 22%. 2. The marginal tax rates didn't change in 2020 as well, but the amount of income taxed...

  • Problem 1-11 The Tax Formula for Individuals, Filing Status and Tax Computation, The Standard Deduction (LO...

    Problem 1-11 The Tax Formula for Individuals, Filing Status and Tax Computation, The Standard Deduction (LO 1.3, 1.5, 1.7) Christine is a single 50-year-old taxpayer with no dependents. Her only income is $40,750 of wages. Calculate her taxable income and her tax liability. Table for the standard deduction Filing Status Standard Deduction Single $ 12,200 Married, filing jointly 24,400 Married, filing separately 12,200 Head of household 18,350 Qualifying widow(er) 24,400 Click here to access the tax tables. Taxable income: ?...

  • Filing 2015 Marginal Tax Rates Married Married Head of Single Filing Filing Household Jointly Separately Status...

    Filing 2015 Marginal Tax Rates Married Married Head of Single Filing Filing Household Jointly Separately Status Tax Rate Income Brackets 10% 0—13,150 15% 0–9,225 18 450 0–9,225 9.226— 18,451– 9,226 37,450 74,900 37,450 37,451–74,901—37,451— 90,750 151,200 75,600 13,151— 50,200 50,201— 129,600 25% 90,7514 151,201 129,601— 209.850 75,601- 28% 189,300 230,450 115,225 189,301 230,451 115,226— 33% 411,500 411,500 205,750 411,501 411,501 205,751- 35% 413,200 464,850 232,425 ||39.6% 413,201+ 464,851+ 232,426+ 209,851- 411,500 411,501- 439,000 439,001+ Use the marginal tax rates to...

  • Problem 1-8 The Tax Formula for Individuals, Filing Status and Tax Computation, Personal and Dependency Exemptions...

    Problem 1-8 The Tax Formula for Individuals, Filing Status and Tax Computation, Personal and Dependency Exemptions (LO 1.3, 1.5, 1.7) Jonathan is a 35-year-old single taxpayer with adjusted gross income in 2019 of $46,300. He uses the standard deduction and has no dependents. Table for the standard deduction Filing Status Standard Deduction Single $ 12,200 Married, filing jointly 24,400 Married, filing separately 12,200 Head of household 18,350 Qualifying widow(er) 24,400 Click here to access the tax tables. a. Calculate Jonathan's...

  • Assume a taxpayer with $60,000 of taxable income. Calculate the amount of tax according to the...

    Assume a taxpayer with $60,000 of taxable income. Calculate the amount of tax according to the following different filing status for 2019: Single Married Filing Jointly Married Filing Separately Head of Household Answers: 9059, 6812, 9059, 7638 Please show the steps to get these answers!!

  • Objective Short Answer Individual ("1"), a single 29 year-old individual, U.S. citizen, not a dependent of...

    Objective Short Answer Individual ("1"), a single 29 year-old individual, U.S. citizen, not a dependent of anyone else, earned $6,000 of wage income and $50,000 of net long-term capital gain recognized in 2019. What is I's Taxable income for 20192 AND What is I's Tax Due in 2019 (excluding any payroll tax (FICA, FUTA et.... 2019 Tax Rate Schedule for Taxpayers (Exhibit 3.9 in textbook) If Taxable income is: Over The Taxis 10% so $9,700 $39,475 $84,200 $ 160,725 $204,100...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT