Question

Please write in MATLAB code Write a program that can calculate the amount of federal tax...

Please write in MATLAB code

Write a program that can calculate the amount of federal tax a person owes for the upcoming year. After calculating the amount of tax owed, you should report to the user their filing status (single/joint), which tax rate they fell under, as well as the tax owed. Example: “As a single filer you fell under 12% tax bracket and you owe $3500.” Disclaimer: This example is simplified and is not intended to be an accurate representation of how to calculate your taxes. 1. Your program should ask the user if they are a single filer, or if they will be filing jointly with their spouse. If they file single, ask the user to input their total income for the year. If they file jointly then have the user enter both their income as well as their spouse’s income. (You can then add the 2 incomes together to obtain gross household income.) 2. Your program should also check to see if the person is eligible for the Earned Income Credit (EIC). EIC eligibility is dependent upon both filing status as well as number of dependents. Therefore, ask the user to enter how many children (dependents) they have. Assume that if the person is eligible then the EIC deducts 8% from the gross income, so that only 92% of the gross income is now taxable. (The EIC will reduce the amount of income which is taxable, but does not change the person’s tax bracket. Ex: If the person made $40,000 (single) then they are in the 22% bracket. The EIC makes their taxable income 40,000*0.92 = $36,800. This new total is within the 12% bracket, but the person still owes 22% of the $36,800.

Earned Income Credit Limits

Filing Status Income Limit if No Children Income Limit if 1 Child Income Limit if 2 Children Income Limit if 3+ Children
Single $15,270 $40,320 $45,802 $49,194
Married Joint $20,950 $46,010 $51,492 $54,884

tax bracket for single filers

Tax Rate   Taxable Income Bracket Tax Owed
10%   $0 to $9,525 10% of taxable income
12% $9,526 to $38,700 $952.50 plus 12% of the amount over $9,525
22% $38,701 to $82,500 $4,453.50 plus 22% of the amount over $38,700
24% $82,501 to $157,500 $14,089.50 plus 24% of the amount over $82,500
32% $157,501 to $200,000 $32,089.50 plus 32% of the amount over $157,500
35% $200,001 to $500,000 $45,689.50 plus 35% of the amount over $200,000
37% $500,001 or more $150,689.50 plus 37% of the amount over $500,000

Tax bracket for joint filers

Tax Rate Taxable Income Bracket Tax Owed
10% $0 to $19,050 10% of taxable income
12% $19,051 to $77,400 $1,905 plus 12% of the amount over $19,050
22% $77,401 to $165,000 $8,907 plus 22% of the amount over $77,400
24% $165,001 to $315,000 $28,179 plus 24% of the amount over $165,000
32% $315,001 to $400,000 $64,179 plus 32% of the amount over $315,000
35% $400,001 to $600,000 $161,379 plus 35% of the amount over $400,000
37% $600,001 or more $161,379 plus 37% of the amount over $600,000
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

% Federal tax calculation

% Reading Filing status
filingType = input("\n Selecct Filing Type: 1-Single 2-Married Joint: ");

income = 0;

% Reading income
if filingType == 1
    income = input("\n Input your income $");
else
    fincome = input("\n Input your income $");
    sincome = input("\n Input your spouse income $");
    income = fincome + sincome;
end % If end

% Reading number of dependants
dependants = input("\n Specify number of dependants: ");

EIC = false;

% Checking for EIC Eligibility
if filingType==1
    if dependants == 0 && income <= 15270
        EIC = true;
    elseif dependants == 1 && income <= 40320
        EIC = true;
    elseif dependants == 2 && income <= 45802
        EIC = true;
    elseif dependants >= 3 && income <= 49194
        EIC = true;
    else
        EIC = false;
    end % If end      
elseif filingType == 2
    if dependants == 0 && income <= 20950
        EIC = true;
    elseif dependants == 1 && income <= 46010
        EIC = true;
    elseif dependants == 2 && income <= 51492
        EIC = true;
    elseif dependants >= 3 && income <= 54884
        EIC = true;
    else
        EIC = false;
    end % If end  
end % If end


incomeCalc = income;

% Updating income if EIC is elegible
if EIC == true
    incomeCalc = income *0.92;
end

tax=0;
taxRate=0;

% Checking tax rate
if filingType == 1
  
    if income >=0 && income <= 9525
        tax = (incomeCalc * 0.10);
        taxRate=10;
    elseif income >=9526 && income <= 38700
        tax = 952.50 + ((incomeCalc-9525) * 0.12);
        taxRate = 12;
    elseif income >=38701 && income <= 82500
        tax = 4453.50 + ((incomeCalc-38700) * 0.22);
        taxRate = 22;
    elseif income >=82501 && income <= 157500
        tax = 14089.50 + ((incomeCalc-82500) * 0.24);
        taxRate = 24;
    elseif income >=157501 && income <= 200000
        tax = 32089.50 + ((incomeCalc-157500) * 0.32);
        taxRate = 32;
    elseif income >=200001 && income <= 500000
        tax = 45689.50 + ((incomeCalc-157500) * 0.35);
        taxRate = 35;
    elseif income >=500000
        tax = 150689.50 + ((incomeCalc-500000) * 0.37);
        taxRate = 37;
    end

elseif filingType == 2

    if income >=0 && income <= 19050
        tax = (incomeCalc * 0.10);
        taxRate=10;
    elseif income >=19051 && income <= 77400
        tax = 1905 + ((incomeCalc-19050) * 0.12);
        taxRate = 12;
    elseif income >=77401 && income <= 16500
        tax = 8907 + ((incomeCalc-77400) * 0.22);
        taxRate = 22;
    elseif income >=165001 && income <= 315000
        tax = 28179 + ((incomeCalc-16500) * 0.24);
        taxRate = 24;
    elseif income >=315001 && income <= 400000
        tax = 64179 + ((incomeCalc-315000) * 0.32);
        taxRate = 32;
    elseif income >=400001 && income <= 600000
        tax = 161379 + ((incomeCalc-400000) * 0.35);
        taxRate = 35;
    elseif income >=600000
        tax = 161379 + ((incomeCalc-600000) * 0.37);
        taxRate = 37;
    end

end % If end
    
    
    
% Printing result
if filingType == 1
    fprintf("\n As a single filer you fell under %d%% tax bracket and you owe $%.2f. \n", taxRate, tax);
else
    fprintf("\n As a Married Joint filer, you fell under %d%% tax bracket and you owe $%.2f. \n", taxRate, tax);
end % If end   

____________________________________________________________________________________

Sample Run:

Add a comment
Know the answer?
Add Answer to:
Please write in MATLAB code Write a program that can calculate the amount of federal tax...
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
  • (python only) Write a program that asks the user for their filing status (single or married)...

    (python only) Write a program that asks the user for their filing status (single or married) and their taxable income. Then, using the below table, compute the tax owed and display the filing status, taxable income, and tax owed. If the filing status is single and the taxable income is overbut not over   the tax is of the amount over$0$9,52510%0$9,526$38,700$952.50 + 12%$9,525$38,701$82,500$4,453.50 +22% $38,700 $82,501unlimited$14,089.50 +24% $82,500 If the filing status is married filing jointly and the taxable income is overbut...

  • Geronimo files his tax return as a head of household for year 2018. If his taxable...

    Geronimo files his tax return as a head of household for year 2018. If his taxable income is $225,000, what is his average tax rate? (Use Tax rate schedules) Multiple Choice 23.58% 25.51% 28.23% 35.00% None of the choices are correct. 2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The tax is: $ 9,525 10% of taxable in $ 9,525 $ 38,700 $952.50 plus 12% of the excess over $9,525 $ 38,700 $...

  • Campbell, a single taxpayer, earns $400,000 in taxable income and $2,000 in interest from an investment...

    Campbell, a single taxpayer, earns $400,000 in taxable income and $2,000 in interest from an investment in the State of New York bonds. (Use the U.S. tax rate schedule). Required: If Campbell earns an additional $15,000 of taxable income, what is her marginal tax rate on this income? What is her marginal rate if, instead, she had $15,000 of additional deductions? 2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The tax is: $...

  • 2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The...

    2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The tax is: $ 0 $ 9.525 10% of taxable income $ 9,525 $ 38,700 5952.50 plus 12% of the excess over $9,525 $ 38,700 $ 82,500 $4,453.50 plus 22% of the excess over $38,700 $ 82,500 $157,500 $14.089.50 plus 24% of the excess over $82,500 $157,500 $200,000 $32.089.50 plus 32% of the excess over $157,500 $200,000 $500,000 $45.689 50 plus 35% of the excess...

  • 2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The...

    2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The tax is $ 9,525 10% of taxable income $ 9,525 $ 38,700 S 82,500 $952.50 plus 12 % of the excess over $9,525 38,700 S S2,500 $4,453.50 plus 22% of the excess over $38,700 $14,089.50 plus 24% of the excess over $82,500 $157,500 $32,089.50 plus 32% of the excess over $157,500 $157,500 $200,000 $200,000 $500,000 $45,689.50 plus 35% of the excess over S200,000 $150,689.50...

  • Lily Tucker (single) owns and operates a bike shop as a sole proprietorship. In 2018, she...

    Lily Tucker (single) owns and operates a bike shop as a sole proprietorship. In 2018, she sells the following long-term assets used in her business: Asset Building Equipment Sales Price $234, 400 84,400 Cost $ 204,400 152,400 Accumulated Depreciation $56, 400 27,400 Lily's taxable income before these transactions is $164,900. What are Lily's taxable income and tax liability for the year? Use Tax Rate Schedule for reference. (Do not round intermediate calculations. Round your answers to the nearest whole dollar...

  • 2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The...

    2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The tax is: $ 0 $ 9.525 10% of taxable income $ 9,525 $ 38,700 5952.50 plus 12% of the excess over $9,525 $ 38,700 $ 82,500 $4,453.50 plus 22% of the excess over $38,700 $ 82,500 $157,500 $14.089.50 plus 24% of the excess over $82,500 $157,500 $200,000 $32.089.50 plus 32% of the excess over $157,500 $200,000 $500,000 $45.689 50 plus 35% of the excess...

  • Marc, a single taxpayer, earns $135,000 in taxable income and $2,500 in interest from an investment...

    Marc, a single taxpayer, earns $135,000 in taxable income and $2,500 in interest from an investment in city of Birmingham Bonds. Using the U.S. tax rate schedule for year 2018, what is his average tax rate? (Use tax rate schedule) Multiple Choice 19.77% 16.54% 11.96% 26.54% None of the choices are correct. 2018 Tax Rate Schedules Individuals Schedule X-Single If taxable income is over: But not over: The tax is: $ 0 $ 9,525 10% of taxable income $ 9,525...

  • Lacy is a single taxpayer. In 2018, her taxable income is $46,800. What is her tax...

    Lacy is a single taxpayer. In 2018, her taxable income is $46,800. What is her tax liability in each of the following alternative situations? Use Tax Rate Schedule, Dividends and Capital Gains Tax Rates, Estates and Trusts for reference. (Do not round intermediate calculations. Round your answer to 2 decimal places.) a. All of her income is salary from her employer.​ Tax liability:$____________ b. Her $46,800 of taxable income includes $1,400 of qualified dividends. Tax liability:$____________ c. Her $46,800 of...

  • Jorge and Anita, married taxpayers, earn $190,500 in taxable income and $30,000 in Interest from an...

    Jorge and Anita, married taxpayers, earn $190,500 in taxable income and $30,000 in Interest from an Investment in City of Heflin bonds. Using the U.S. tax rate schedule for married filing Jointly, how much federal tax will they owe? What is their average tax rate? What is their effective tax rate? What is their current marginal tax rate? (Do not round Intermediate calculations. Round your answers to 2 decimal places.) Federal tax Average tax rate Effective tax rate Marginal tax...

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