prompt
the first popup should look something like this i made.
<script type="text/javascript">
document.write('<div style="text-align:center">');
document.write('<h1>');
document.write("Geometry Calculator");
var figure = "Please Select a figure from the following list (enter a number):";
var figure = figure + "<br /> \n (1) cone \n (2) cube \n (3) cylinder \n (4) prism \n (5) pyrimid";
var figure = parseFloat(prompt(figure, "1"));
</script>
---------
now how to i make certain popups say for example
(1) cone ask for 2 popup windows asking
1. what is the height
2. what is the radius
i am trying to use something to this effect.
switch (figure){
case "1":
function computeCone(radius, height)
{var radius = prompt("Please enter the radius of the base (in inches):", "5");
var height = prompt("Please enter the height (in inches):", "8"); }
break;
case "2":
function computeCube(length)
{var length = prompt("Please enter the length of a base edge (in inches):", "3");}
break;
case "3":
function computeCylinder(radius, height)
{var radius = prompt("Please enter the radius of the base (in inches):", "5");
var height = prompt("Please enter the height (in inches):", "8");}
break;
case "4":
function computePrism(length, height)
{var length = prompt("Please enter the length of a base edge (in inches):", "3");
var height = prompt("Please enter the height (in inches):", "8");}
break;
case "5":
function computePyrimid(length, height)
{var length = prompt("Please enter the length of a base edge (in inches):", "3");
var height = prompt("Please enter the height (in inches):", "8");}
break;
} |