Question

Using Javascript

Use document.getElementById to do this part.

The IRS 1040 EZ form is for people with no itemized deductions filing as single or married couple.  The deduction is calculated based on these rules:  If someone can claim you as depend on their return, then the deduction is 3900 for single and 6550 for married; otherwise the deduction is 6550 for single and 11800 for married.  The taxable income is computed by the formula: taxable income = total income – deduction.  The tax is calculated based on the filing status and taxable income.  The tax rate schedules for single filing status are:

If the taxable income is

At least

But less than

Tax

0

22100

15% of the taxable income

22100

53500

3315+28% of the amount over 22100

53500

115000

12107+31% of the amount over 53500

115000

250000

31172+36% of the amount over 115000

250000

79772+39.6% of the amount over 250000

The tax rate schedules for married couple filing a joint return are:

If the taxable income is

At least

But less than

Tax

0

36900

15% of the taxable income

36900

89150

5535+28% of the amount over 36900

89150

140000

20165+31% of the amount over 89150

140000

250000

35928.5+36% of the amount over 140000

250000

75528.5+39.6% of the amount over 250000

Test your program with these inputs:

(1)   Single, total income 75000 and is a dependent of some people.  The tax should be 17563.

(2)   Married, total income 95000 and is not a dependent.  The tax should be 18499.

Validation requirement: The total income must be between 0 and 500,000.

1040EZ Form Tax Calculation Name: John Smith Filing Status: Single O Married Total income: 75000 Check this box if someone cl

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

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new web page with name "tax.html" is created, which contains following code.

tax.html :

<!DOCTYPE html>

<html lang="en">

<head>

<!-- title for web page -->

<title>1040EZ Form Tax Calculation</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- <script> is used for Javascript -->

<script src="tax.js"></script>

</head>

<body>

<h4>1040EZ Form Tax Calculation</h4>

Name :

<!-- textbox form name -->

<input type="text" id="txtName"/>

<br><br>

Filling Status :

<!-- radio button for filling status -->

<input type="radio" name="fillingStatus" id="single" value="Single"/>Single

<input type="radio" name="fillingStatus" id="married" value="Married"/>Married

<br><br>

Total Income :

<!-- textbox for total income -->

<input type="text" id="txtTotalIncome"/>

<br><br>

<!-- checkbox to display claims -->

<input type="checkbox" name="chkClaims"/>

Check this box if someone claims you on their return

<br><br>

<!-- textbox to display deductions -->

Deduction:<input type="text" id="txtDeduction"/>

<br><br>

<!-- textbox to display taxable income -->

Taxable income:<input type="text" id="txtTaxableIncome"/>

<br><br>

<!-- textbox to display tax -->

Tax:<input type="text" id="txtTax"/>

<br><br>

<!-- button to call function -->

<input type="button" value="Compute Tax" onclick="calculateTaxAndIncome()"/>

</body>

</html>

*************************

tax.js :

//function to calculate tax

function calculateTaxAndIncome()

{

var claimsAmount=0;//declaring variale to store claim amount

//get name

var name=document.getElementById("txtName").value;

//get total income

var incomeTaxAmount=parseInt(document.getElementById("txtTotalIncome").value);

//checking if checkbox for claim is checked

if(document.getElementsByName("chkClaims")[0].checked && document.getElementById("single").checked)

{

//if having dependent for single tax payer

claimsAmount=3900;//set claim

}

else if(document.getElementsByName("chkClaims")[0].checked && document.getElementById("married").checked)

{

//having dependent for married tax payer

claimsAmount=6550;//set claim

}

else if(document.getElementById("single").checked)

{ //no dependent but single tax payer

claimsAmount=6550;//set claim

}

else if(document.getElementById("married").checked)

{ //no dependent but married tax payer

claimsAmount=11800;

}

//checking total income

if(!(incomeTaxAmount<0 || incomeTaxAmount>500000))

{

incomeTaxAmount=incomeTaxAmount-claimsAmount;

//declaring variable to store income tax

var totalTax=0;

//checking which radio button is selected

if(document.getElementById("single").checked)

{

//checking incomeTaxAmount

if(incomeTaxAmount>0 && incomeTaxAmount <22100)

{

totalTax=incomeTaxAmount*0.15;

}

//if income is between 22100 and 53500

else if(incomeTaxAmount>=22100 && incomeTaxAmount <53500)

{

//tax is 28%

totalTax=3315+(incomeTaxAmount-22100)*0.28;

}

//if income is between 53500 and 115000

else if(incomeTaxAmount>=53500 && incomeTaxAmount <115000)

{

//tax is 31%

totalTax=12107+(incomeTaxAmount-53500)*0.31;

}

//if income is between 115000 and 250000

else if(incomeTaxAmount>=115000 && incomeTaxAmount <250000)

{

//tax is 36%

totalTax=31172+(incomeTaxAmount-115000)*0.36;

}

else if(incomeTaxAmount >250000)

{

//tax is 39.6%

totalTax=79772+(incomeTaxAmount-250000)*0.396;

}

}

//if married radio button is selected

else if(document.getElementById("married").checked)

{

//checking incomeTaxAmount

if(incomeTaxAmount>0 && incomeTaxAmount <36900)

{

totalTax=incomeTaxAmount*0.15;

}

//if income is between 36900 and 89150

else if(incomeTaxAmount>=36900 && incomeTaxAmount <89150)

{

//tax is 28%

totalTax=5535+(incomeTaxAmount-36900)*0.28;

}

//if income is between 89150 and 140000

else if(incomeTaxAmount>=89150 && incomeTaxAmount <140000)

{

//tax is 31%

totalTax=20165+(incomeTaxAmount-89150)*0.31;

}

//if income is between 140000 and 250000

else if(incomeTaxAmount>=140000 && incomeTaxAmount <250000)

{

//tax is 36%

totalTax=35928.5+(incomeTaxAmount-140000)*0.36;

}

else if(incomeTaxAmount >250000)

{

//tax is 39.6%

totalTax=75528.5+(incomeTaxAmount-250000)*0.396;

}

}

//display details

document.getElementById("txtDeduction").value="$"+claimsAmount.toFixed(2);

document.getElementById("txtTaxableIncome").value="$"+(incomeTaxAmount).toFixed(2);

//display tax

document.getElementById("txtTax").value="$"+totalTax.toFixed(2);

}

else

{

//alert user

alert("Enter total income between 0 to 500000");

}

}

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

Output : Open web page tax.html in the browser and will get the screen as shown below

Screen 1 :tax.html

1040EZ Form Tax Calculation x+ ぐ → C ⓘlocalhost8080/tax.html 1040EZ Form Tax Calculation Name Filling Status: Single Married

Screen 2:showing details for single person with dependent

1040EZ Form Tax Calculation x+ ぐ → C ⓘlocalhost:8080/tax.html 1040EZ Form Tax Calculation Name John Smith Filling Status : Si

Screen 3:showing details for married person with no dependent

1040EZ Form Tax Calculation x+ Clocalhost:8080/tax.html 1040EZ Form Tax Calculation Name John Smith Filling Status : O Single

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Using Javascript Use document.getElementById to do this part. The IRS 1040 EZ form is for people...
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
  • Determine the amount of tax liability in each of the following instances: Use the appropriate Tax...

    Determine the amount of tax liability in each of the following instances: Use the appropriate Tax Tables and Tax Rate Schedules. A married couple filing jointly with taxable income of $32,991. A married couple filing jointly with taxable income of $192,257. A married couple filing separately, one spouse with taxable income of $43,885 and the other with $56,218. A single person with taxable income of $79,436. A single person with taxable income of $297,784. A head of household with taxable...

  • Please solve this for me and fill the table. Show calculations 5. Use Tax Rate Schedules....

    Please solve this for me and fill the table. Show calculations 5. Use Tax Rate Schedules. Carson Wentz, of Phildelphia, determined the following tax information: salary, $144,000; interest earned, $2,000; qualified retirement plan contribution, $6,000; itemized deductions, $10,000. Filing single, calculate Carson's taxable income and tax liability. Wages, salaries, tips, etc. Taxable interest (+) Total income Adjustments to income: IRA deduction (-) Adjusted gross income Standard deduction (2019) or itemized deductions (-) Taxable income Tax (use 2019 Tax Rate Schedules...

  • Calculate the 2017 total tax for Gordon Geist, a single taxpayer without dependents and no itemized deductions. He has active income of $43,000, a short-term capital gain income of $4,400 from the sa...

    Calculate the 2017 total tax for Gordon Geist, a single taxpayer without dependents and no itemized deductions. He has active income of $43,000, a short-term capital gain income of $4,400 from the sale of stock, and S6,400 from book royalties. What is Gordon's average tax rate? Gordon's total gross income for the 2017 tax year is (Round to the nearest cent) Assuming Gordon's filing status is single, his standard deduction for the 2017 tax year is (Enter the amount to...

  • please solve and fill the table for me. Show calculations 3. Determine Tax Liability. Find the...

    please solve and fill the table for me. Show calculations 3. Determine Tax Liability. Find the tax liabilities based on the taxable income of the following people: Taxable income Tax (use 2019 Tax Rate Schedules for calculate tax liability) (a) married couple, $92,225 (b) married couple, $74,170 (c) single person, $27,880 (d) single person, $56,060 4. Use Tax Rate Schedules. Jared Goff, of Los Angeles, determined the following tax information: gross salary, $160,000; interest earned, $2,000; IRA contribution, $5,000; and...

  • Use Worksheet 3.1, Use Worksheet 3.2. Henry Zhao graduated from college in 2014 and began work...

    Use Worksheet 3.1, Use Worksheet 3.2. Henry Zhao graduated from college in 2014 and began work as a systems analyst in July 2014. He is preparing to file his income tax return for 2014 and has collected the following financial information for calendar year 2014: Tuition, scholarships, and grants $5,750 Scholarship, room, and board 1,850 Salary 30,250 Interest income 185 Deductible expenses, total 3,000 Income taxes withheld 2,600 EXHIBIT 3.3    Sample Tax Rate Schedules Tax rates levied on personal income vary...

  • Taxation

    2017 Income Tax BracketsSingleTaxable IncomeTax Rate$0 - $9,32510%$9,326 - $37,950$932.50 plus 15% of the amount over $9,325$37,951 - $91,900$5,226.25 plus 25% of the amount over $37,950$91,901 - $191,650$18,713.75 plus 28% of the amount over $91,900$191,651 - $416,700$46,643.75 plus 33% of the amount over $191,650$416,701 - $418,400$120,910.25 plus 35% of the amount over $416,700$418,401 or more$121,505.25 plus 39.6% of the amount over $418,400Married Filing Jointly or Qualifying Widow(er)Taxable IncomeTax Rate$0 - $18,65010%$18,651 - $75,900$1,865 plus 15% of the amount over $18,650$75,901...

  • 2017 Income Tax Brackets Single Taxable Income Tax Rate $0 - $9,325 10% $9,326 - $37,950...

    2017 Income Tax Brackets Single Taxable Income Tax Rate $0 - $9,325 10% $9,326 - $37,950 $932.50 plus 15% of the amount over $9,325 $37,951 - $91,900 $5,226.25 plus 25% of the amount over $37,950 $91,901 - $191,650 $18,713.75 plus 28% of the amount over $91,900 $191,651 - $416,700 $46,643.75 plus 33% of the amount over $191,650 $416,701 - $418,400 $120,910.25 plus 35% of the amount over $416,700 $418,401 or more $121,505.25 plus 39.6% of the amount over $418,400 Married...

  • Assignment Score: S00% nt: Chapter 3 HW Save Submit Assignment for Grading e Question 3 of...

    Assignment Score: S00% nt: Chapter 3 HW Save Submit Assignment for Grading e Question 3 of 4 ch03 Financial Planning Exercise 4 Check My Work eBook Chapter 3 Financial Planning Exercise 4 Effect of tax credit vs. tax exemption By defining after-tax income, demonstrate the differences resulting from a $500 tax credit versus a $500 tax deduction for a single taxpayer in the 25% tax bracket with $40,000 of pre-tax income. Round your answers to two decimal places. (Use Exhibit...

  • David and Ruby are engaged and plan to get married. During 2020, David is a full-time...

    David and Ruby are engaged and plan to get married. During 2020, David is a full-time student and earns $9,400 from a part-time job. With this income, student loans, savings, and nontaxable scholarships, he is self-supporting. For the year, Ruby is employed and has wages of $79,200. Click here to access the standard deduction table to use. Click here to access the Tax Rate Schedules. If an amount is zero, enter, "0". Do not round your intermediate computations. Round your...

  • Form 1040 Complete Patty's Form 1040 Form Department of the Treasury-Internal Revenue Service (99) 1040 U.S....

    Form 1040 Complete Patty's Form 1040 Form Department of the Treasury-Internal Revenue Service (99) 1040 U.S. Individual Income Tax Return2018 OMB No. 1545-0074 IRS Use Only Filing status: Single Your first name and initial Patty Your standard deduction: None Your social security number 466-33-1234 Last name Banyan If joint return, spouse's first name and initial Last name Spouse's social security number Full-year health care coverage or exempt (see inst.) Spouse standard deduction: None Home address (number and street). If you...

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