49 lines
1.7 KiB
HTML
49 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
|
|
-->
|
|
<html>
|
|
<head>
|
|
<title>TODO supply a title</title>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<script>
|
|
var numOfDependants = prompt("Please enter the number of dependants.");
|
|
var grossPay = prompt("Please enter the gross pay: ");
|
|
|
|
if (numOfDependants == 0) {
|
|
if (grossPay <= 1000) {
|
|
var taxRate = "33%";
|
|
} else {
|
|
var taxRate = "28%";
|
|
}
|
|
} else if (numOfDependants <= 3) {
|
|
if (grossPay <= 1000) {
|
|
var taxRate = "25%";
|
|
} else {
|
|
var taxRate = "22%";
|
|
}
|
|
} else if (numOfDependants <= 6) {
|
|
if (grossPay <= 1000) {
|
|
var taxRate = "22%";
|
|
} else {
|
|
var taxRate = "15%";
|
|
}
|
|
} else if (numOfDependants <= 7) {
|
|
if (grossPay <= 1000) {
|
|
var taxRate = "15%";
|
|
} else {
|
|
var taxRate = "10%";
|
|
}
|
|
}
|
|
var output = "Number of Dependants: " + numOfDependants + "<br>";
|
|
output += "Gross Pay: $" + grossPay + "<br>";
|
|
output += "Tax Rate: " + taxRate + "<br>";
|
|
|
|
document.write(output);
|
|
|
|
</script>
|
|
</head>
|
|
</html>
|