I have had a good hard look and cant see any faults, any help would be much appreciated
<html>
<head>
<title>Loops</title>
<script type = "text/javascript">
var name, age, income, cost
name = window.prompt("Enter your name")
age = window.prompt("Enter your age")
do
{
parseInt(income) = window.prompt("Enter monthly income")
if(income >= 0 && income <= 3000)
{
if(age >= 60)
{
cost = 50
}
else if (age <= 59 && age >= 40)
{
cost = income * 0.085
}
else
{
cost = (income * 0.1) + 95
}
else
{
cost = 0
}
}
}while(income > 0)
document.write("</br>PATIENT NAME : " + name)
document.write("</br>PATIENT AGE : " + age)
document.write("</br>MONTHLY INCOME : R" + income)
document.write("</br>COST OF TREATMENT : R" + cost)
</script>
</head>
</html>

New Topic/Question
Reply


MultiQuote





|