LonelyShepherd

Volume of cilinder [Лаб. 3.3]

Dec 25th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8">
  5.         <title>Volume of Cilinder</title>
  6.         <script type="text/javascript">
  7.             function Cilinder(height, radius) {
  8.                 this.height = height;
  9.                 this.radius = radius;
  10.             }
  11.  
  12.             Cilinder.prototype.getVolume = function() {
  13.                 return 3.14 * this.radius*this.radius * this.height;
  14.             };
  15.  
  16.             var r = prompt("Radius"),
  17.                     h = prompt("Hight");
  18.  
  19.             cilinder = new Cilinder(h, r);
  20.  
  21.             alert(cilinder.getVolume());
  22.         </script>
  23.     </head>
  24.     <body>
  25.     </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment