The program in question should simply take two inputs, convert each one using Number, and then multiply them – assigning the result to a seperate variable. It should then display that value using an alert() method.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
function taxCalculator(price, taxRate) {
var price = parseInt(prompt("What is the price of the item you're about to buy? ex: 10.00"));
var taxRate = parseInt(prompt("What is the state tax rate? ex: 0.08"));
priceAfterTax = price + (price * taxRate);
return priceAfterTax
}
alert(priceAfterTax);
</script>
</body>
</html>
What am I totally missing here? I’ve googled individual facets of this code, and can’t understand why it’s not working in toto.