Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i am trying to get this library file income.js using this, to be loaded with the

ID: 3922613 • Letter: I

Question

i am trying to get this library file income.js using this, to be loaded with the tazes.html and use the incometzs function to calculate and display the income tax,

}

*^js code***/ html code*

<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

hey heres the code, if you have any doubts or problems post comments.

Taxes.html

<html>
<head>
<script>
function itemized(x,val)
{
Incometax(x,val);
}

function Incometax(x,val)
{
var deduction, taxableIncome, totaltax,income;

deduction= Math.max(x, 4150);

income=val;

taxableIncome = Math.max(income - deduction, 0);

totaltax = 0.13*taxableIncome;

document.getElementById("outputDiv").innerHTML = totaltax;
}

</script>


</head>



<body>

<div>

<h2>taxes</h2>

<p>

click to compute

</p>
<input type="button" value='100000.00'>

<input type="button" value='42500.00'>

<input type="button" value='13267.45'>




<div id='outputDiv'></div>

</div>

</body>

</html>