trying to get this html to calculate tax values, useing a js library file, <scri
ID: 3923963 • Letter: T
Question
trying to get this html to calculate tax values, useing a js library file,
<script type="text/javascript">
{
var number;
function Icometace(income, itemized)
// Assynes: income .=0, itemzed .=0
// Returns: flat tax (13%) due after deductions
{
var deduction, taxableIcome, total tax;
deduciton= Math.max(itermized, 4150):
taxableIncome = Math.max(income - debuction, o);
toatltax = 0.13*tableTincome
return totaltax;
}
*^js code***/ html code*
<html>
<head>
<title> taxes </title>
<script type="text/javascript">
{
var number;
function Icometace(income, itemized)
// Assynes: income .=0, itemzed .=0
// Returns: flat tax (13%) due after deductions
{
var deduction, taxableIcome, total tax;
deduciton= Math.max(itermized, 4150):
taxableIncome = Math.max(income - debuction, o);
toatltax = 0.13*tableTincome
return totaltax;
}
}
</script>
</head>
<body>
<div>
<h2>taxes</h2>
<p>
click to compute
</p>
<input type="button" value="income 100000.00">
<input type="button" value="income 42500.00">
<input type="button" value="income 13267.45">
<hr>
<div id="outputDiv"></div>
</div>
</body>
</html>
Explanation / Answer
<html>
<head>
<title> taxes </title>
<script type="text/javascript">
{
var number;
function itemized(income)
// Assynes: income .=0, itemzed .=0
// Returns: flat tax (13%) due after deductions
{
var deduction, taxableIncome, totaltax;
deduction= 4150
taxableIncome = income - deduction;
totaltax = 0.13*taxableIncome
alert('Total tax is ' + totaltax);
}
}
</script>
</head>
<body>
<div>
<h2>taxes</h2>
<p>
click to compute
</p>
<input type="button" value="income 100000.00">
<input type="button" value="income 42500.00">
<input type="button" value="income 13267.45">
<input type="" name="">>
<hr>
<div id="outputDiv"></div>
</div>
</body>
</html>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.