I am having trouble trying to get the following to work. It will pass the radius, but not the height. Any help you can be would be greately appreciated,
var rad = parseInt(prompt("Enter the radius of the cylinder: "));
var hgt = parseInt(prompt("Enter the height of the cylinder: "));
var myCylinder = new Cylinder(rad);
var myCylheight = new Cylheight(hgt);
alert("The cylinder's volume is " + myCylinder.volume() + " units");
alert("The cylinder's Surface Area is " + myCylinder.surface_area() + " units");
</script>
</body>
</html>
Bookmarks