ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 04 May 2017 My Price 9.00

Develop the Income Tax Calculator

 Develop the Income Tax Calculator

 

In this exercise, you’ll use nested if statements and arithmetic expressions to calculate the income tax that is owed for a taxable income amount. When a user enters his taxable income and clicks the Calculate button, this application will display the federal income tax owed.

 

This is the 2015 table for the federal income tax on individuals that you should use for calculating the tax:

Taxable income

Income tax

Over…

But not over…

 

Of excess over…

$0

$9,225

$0 plus 10%

$0

$9,225

$37,450

$922.50 plus 15%

$9,225

$37,450

$90,750

$5,156.25 plus 25%

$37,450

$90,750

$189,300

$18,481.25 plus 28%

$90,750

$189,300

$411,500

$46,075.25 plus 33%

$189,300

$411,500

$413,200

$119,401.25 plus 35%

$411,500

$413,200

 

$119,996,25 plus 39.6%

$413,200

  1. Open the HTML and JavaScript files in this folder:

exercises_extrach04income_tax

Note that the JavaScript file has some starting JavaScript code for this application, including the $ function and an onload event handler that attaches a function named processEntry to the click event of the Calculate button.

  1. Code the processEntry function. It should get the user’s entry and make sure it’s a valid number. If it isn’t, it should display an error message. If it is valid, it should pass the value to a function named calculateTax, which should return the tax amount. That amount should then be displayed in the second text box.
  2. Code the calculateTax function, but to start just write the code for calculating the the tax for any amount within the first two brackets in the table above. The tax should be rounded to two decimal places, and it should be returned to the calling function. To test this, use income values of 9225 and 37450, which should display taxable amounts of 922.50 and 5156.25.
  3. Add the JavaScript code for the next tax bracket. Then, if you have the time, add the JavaScript code for the remaining tax brackets.

Attachments:

Answers

(11)
Status NEW Posted 04 May 2017 01:05 AM My Price 9.00

-----------

Not Rated(0)