SHARE
TWEET

Untitled

a guest Sep 11th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html lang="en">
  2. <head>
  3.     <meta charset="UTF-8">
  4.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  6.     <title>Hanif Abyan Ayyasyi XI RPL 2</title>
  7. </head>
  8. <body>
  9.     <p id="test"></p>
  10.  
  11.     <script>
  12.         function SegiEmpat()
  13.         {
  14.             this.panjang = 0;
  15.             this.lebar = 0;
  16.             this.hitungLuas = function()
  17.             {
  18.                 var luas = this.panjang * this.lebar;
  19.                 return luas;
  20.             }
  21.             this.hitungKeliling = function()
  22.             {
  23.                 var keliling = 2 * (this.panjang + this.lebar);
  24.                 return keliling;
  25.             }
  26.         }
  27.         var s = new SegiEmpat();
  28.         s.panjang = 4;
  29.         s.lebar = 3;
  30.         alert("Luas adalah " + s.hitungLuas() + " cm");
  31.         alert("Keliling adalah " + s.hitungKeliling() + " cm")
  32.     </script>
  33. </body>
  34. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top