Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why does this code not end when i enter q?

    Code:
    <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>

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nvm, i got the answer, no need to bother anyone =)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •