Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Volume of Cilinder</title>
- <script type="text/javascript">
- function Cilinder(height, radius) {
- this.height = height;
- this.radius = radius;
- }
- Cilinder.prototype.getVolume = function() {
- return 3.14 * this.radius*this.radius * this.height;
- };
- var r = prompt("Radius"),
- h = prompt("Hight");
- cilinder = new Cilinder(h, r);
- alert(cilinder.getVolume());
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment