View Single Post
  #2 (permalink)  
Old Oct 16th, 2003, 08:17
u2orange u2orange is offline
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Is this what you are looking for?

Code: Select all
<HTML>
<Head>
<TITLE>JAVAScript</TITLE>
</Head>



<BODY>

<Script Language:"javascript">
var x= window.prompt("How many Home PC's would you like?>>");
var y= window.prompt("How many Gamer PC's would you like?>>");
var z= window.prompt("How many business PC's would you like?");
var pu= window.prompt("How many Power user PC's would you like?");
if (x != null && y != null && z != null && pu != null){
	window.confirm("Home PC's = "+x+" Gamer PC's ="+y);
	window.confirm("Business PC's ="+z+" Power User PC's ="+pu);
	var M = ((x*1)+(y*1)+(z*1)+(pu*1))
	var R = ((x*1)+(y*2)+(z*4)+(pu*4))
	var C = ((x*1)+(y*0)+(z*1)+(pu*1))
	var D = ((x*0)+(y*1)+(z*0)+(pu*1))
	
	document.write("For "+x+" Home PCs, "+y+" Gamer PCs, "+z+" Business PCs, and "+pu+" Power User PCs, you will need to order:");

	document.write("

 "+M+" Motherboard(s) </p>");

	document.write("

 "+R+" RAM Module(s) </p>");

	document.write("

 "+C+" CD/RW drive(s) </p>");

	document.write("

 "+D+" DVD drive(s) </p>");

	document.write("<h1>CALCulator</h1>");
	}
else{
	document.write("You cancelled")}

</script>
</body>
</html>
HTH
u2o