...

View Full Version : Why does this code not end when i enter q?



thenextbesthang
10-29-2006, 10:14 PM
<script type = "text/javascript">
function getsalestax(cost)
{
tax = "$" + (cost*.08) + ", ";
document.write(tax);
}
</script>
</head>
<body>
<script type = "text/javascript">
var cost = parseFloat(window.prompt("Enter Cost of Item here"));
var tax;

while (cost != "q")
{
getsalestax(cost);
cost = parseFloat(window.prompt("Enter Cost of Item here"));
}


</script>

thenextbesthang
10-29-2006, 10:39 PM
nvm, i got the answer, no need to bother anyone =)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum