Question
Code the processEntry() function. It should get the users entry and make sure its a valid number greater than zero. If it isnt, it should
Code the processEntry() function. It should get the users entry and make sure its a valid number greater than zero. If it isnt, 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. The focus should be moved to the first text box whether or not the entry is valid. 3. Code the calculateTax() function, but to start, just write the code for calculating the tax for any amount within the first two brackets in the table above. The users entry should be converted to an integer, and the tax should be rounded to two decimal places. To test this, use income values of 9275 and 37650, which should display taxable amounts of 927 and 5183.50. 4. Add the JavaScript code for the next tax bracket. Then, if you have the time, add the JavaScript code for the remaining tax brackets.
"use strict"; var $ = function (id) { return document.getElementById(id); };
function processEntries() {
}
function calculatetax()
{
}
window.onload = function () {
$("calculate").onclick = processEntry;
};
Income Tax Calculator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started