Question

In: Computer Science

Problem 1 The United States Federal Income tax for taxes due July 15, 2020 is available...

Problem 1
        The United States Federal Income tax for taxes due July 15, 2020
    is available at this link: https://www.bankrate.com/finance/taxes/tax-brackets.aspx
        The four tax filing categories are: 0 - single filer, 2 - head of household, 
        3 - married filing jointly or qualifying widow, and 4 - married filing
        seperately. 
        
        Write a Java program that prompts the user to enter the name, filing status, and
        annual income. The program returns the federal income tax due. (10 Points)
        
        A sample run should look like:
        Enter your name: Jane Doe
        Enter your 2019 federal income: 48,000
        Enter your filing status: single
        
        Jane Doe, the federal income tax for an annual salary of
        48,000 for a single filer is $4,800.
        
        
        Draw a UML diagram for the class. You may use Astah tool. (5 points).
        
        
        Submit both the java code and UML diagram.
*       

Solutions

Expert Solution

Here is the Java code:

import java.util.Scanner;

public class USFederal{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        System.out.print("Enter your name: ");
        String name = scan.nextLine();
        System.out.print("Enter your 2019 federal income: ");
        int income = scan.nextInt();       
        System.out.print("Enter your filing status: ");
        String status = scan.next();

        int tax=0;
        
        if(status.equals("single")){
            if(income>=0 && income<=9750){
                           tax = 10;
            }
            if(income>=9701 && income<=39475){
                            tax = 12;
            }
            if(income>=39476 && income<=82200){
                            tax = 22;
            }
            if(income>=82201 && income<=160725){
                            tax = 24;
            }
            if(income>=160726 && income<=204100){
                            tax = 32;
            }        
            if(income>=204101 && income<=510300){
                            tax = 35;
            }        
            if(income>=510301){
                            tax = 37;
            }        
        }
           

        if(status.equals("head")){
            if(income>=0 && income<=13850){
                           tax = 10;
            }
            if(income>=13851 && income<=52850){
                            tax = 12;
            }
            if(income>=52851 && income<=84200){
                            tax = 22;
            }
            if(income>=84201 && income<=160700){
                            tax = 24;
            }
            if(income>=160701 && income<=204100){
                            tax = 32;
            }        
            if(income>=204101 && income<=510300){
                            tax = 35;
            }        
            if(income>=510301){
                            tax = 37;
            }        
        }

        if(status.equals("married filing jointly")){
            if(income>=0 && income<=19400){
                           tax = 10;
            }
            if(income>=19401 && income<=78950){
                            tax = 12;
            }
            if(income>=78951 && income<=168400){
                            tax = 22;
            }
            if(income>=168401 && income<=321450){
                            tax = 24;
            }
            if(income>=321451 && income<=408200){
                            tax = 32;
            }        
            if(income>=408201 && income<=612350){
                            tax = 35;
            }        
            if(income>=612351){
                            tax = 37;
            }        
        }

        if(status.equals("married filing separately")){
            if(income>=0 && income<=9700){
                           tax = 10;
            }
            if(income>=9701 && income<=39475){
                            tax = 12;
            }
            if(income>=39476 && income<=84200){
                            tax = 22;
            }
            if(income>=84201 && income<=160725){
                            tax = 24;
            }
            if(income>=160726 && income<=204100){
                            tax = 32;
            }        
            if(income>=204101 && income<=306175){
                            tax = 35;
            }        
            if(income>=306176){
                            tax = 37;
            }        
        }
        
        tax = (income/100)*tax;
        System.out.println("\n"+name+", the federal income tax for an annual salary of "+income+" for a "+status+" filer is "+tax);
  }
}

Output:

UML:


Related Solutions

Research and write the history of the United States Federal Income Tax Law.
Research and write the history of the United States Federal Income Tax Law.
Is the current progressive federal income tax used in the United States equitable?
Is the current progressive federal income tax used in the United States equitable?
The United States federal personal income tax is calculated based on filing status and taxable income....
The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses (in this program we’ll use only three): single filers, married filing jointly, and head of household. The tax rates vary every year. Table 1 shows the rates for 2016. If you are, say, single with a taxable income of $10,000, the first $9,075 is taxed at 10% and the other $925 is taxed at 15%. So, your tax is...
There are two types of taxes: Federal tax and province tax. 1.Federal taxes: Assume that the...
There are two types of taxes: Federal tax and province tax. 1.Federal taxes: Assume that the share of income $35,000 and below is federally taxed at 15%, the share of income between $35,000 and $100,000 is taxed at 25%, and the share of income over $100,000 is taxed at 35%. (i.e an income over$ 100,000 is taxed as follows: -The portion of income up to and including the first $35,000 is federally taxed at 15%. -The portion of income between...
Federal Withholding Taxes versus Estimated Tax Payments 1. Summarize the difference between federal income tax withheld...
Federal Withholding Taxes versus Estimated Tax Payments 1. Summarize the difference between federal income tax withheld and federal estimated tax payments. 2. Summarize the general rule for federal estimated tax payments. You may use the following sources to research the answers: (1) learning objectives 9.1 and 9.2 of your text book, or IRS Publication 505 “Tax Withholding and Estimated Tax” for use in 2017 at https://www.irs.gov/pub
1. Tax avoidance measures have little impact on corporate taxes in the United States. A) True....
1. Tax avoidance measures have little impact on corporate taxes in the United States. A) True. B) False 2. The absolutist argument in favor of the taxation of corporate income is based on the premise that much corporate income escapes taxation under the individual income tax laws.          A)  True. B)  False.
1.Potatoes are available in the United States and in Mexico. Income has risen by 10 percent...
1.Potatoes are available in the United States and in Mexico. Income has risen by 10 percent in each country. The demand for potatoes has increased by 2 percent in the United States and by 17 percent in Mexico. What can be concluded? A. Potatoes are normal goods in both countrie B. Potatoes are normal goods in the United States but inferior goods in Mexico. C. Potatoes are inferior goods in the United States but normal goods in Mexico. D. Potatoes...
Taxes: The Internal Revenue Service reports that the mean federal income tax paid in the year...
Taxes: The Internal Revenue Service reports that the mean federal income tax paid in the year 2010 was $8040 . Assume that the standard deviation is $4700 . The IRS plans to draw a sample of 1000 tax returns to study the effect of a new tax law. (a) What is the probability that the sample mean tax is less than $8000 ? Round the answer to at least four decimal places. The probability that the sample mean tax is...
For federal taxes, we have a marginally based income tax. There are other options. What are...
For federal taxes, we have a marginally based income tax. There are other options. What are some of them and which would be best? Why do you think so?
Taxes: The Internal Revenue Service reports that the mean federal income tax paid in the year...
Taxes: The Internal Revenue Service reports that the mean federal income tax paid in the year 2010 was $8040. Assume that the standard deviation is $490. The IRS plans to draw a sample of 1000 tax returns to study the effect of a new tax law. Part 1 of 5 (a) What is the probability that the sample mean tax is less than $8200? Round the answer to at least four decimal places. The probability that the sample mean tax...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT