Question: In this exercise, youll use nested if statements and arithmetic expressions to calculate the income tax that is owed for a taxable income amount. To
In this exercise, youll use nested if statements and arithmetic expressions to calculate the income tax that is owed for a taxable income amount. To do that, youll use a prompt statement that displays a dialog box like this to get the value of a users taxable income:
Then, youll calculate the amount of tax thats owed and use an alert statement to display that amount like this:
Below is a sample tax table for the federal income tax on individuals that you should use for calculating the tax:
Open the start-up HTML file provided for this homework. It has some starting JavaScript code for this application, including a do-while loop and a prompt statement for getting the users entry while the entry amount isnt 99999.
Write the JavaScript code for calculating the tax owed for any amount within the first two brackets in the table above. To test that, use income values between 8700 and 35350, which should display taxable amounts of $870 and 15% of (Taxable Income minus $8,700). For example, if the Taxable Income entered is $25,000, your application should return $3,315.
If you havent already provided data validation for the users entry, test to make sure that it is a positive number before calculating the tax owed.
Add the JavaScript code for the next tax brackets from the above table.
PreviousNext
Below is a sample tax table for the federal income tax on individuals that you should use for calculating the tax: Taxable income ncome tax Over.. But not over... Of excess over... $0 plus 10% $870 plus 15% $4867 plus 25% $17,442 plus 28% $0 $8,700 $0 $35,350 $8,700 $35,350 $85,650 $35,350 $85,650 $178,650 $85,650 $178,650 $388,350 $43,482 plus 33% $178,650 $388,350 $112,683 plus 35% $388,350
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
