ilham_hax0r

Transaksi Penjualan (JavaScript)

Dec 16th, 2016
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!--Indonesian C0der Leak-->
  2. <!--Created By : Ilham Wicaksono :)-->
  3.  
  4. <html>
  5.     <head>
  6.         <title>Transaksi Penjualan</title>
  7.     </head>
  8.     <body>
  9.         <script type="text/javascript">
  10.             var h1,j1,h2,j2,total,diskon;
  11.  
  12.             h1 = parseInt(prompt("Masukkan Harga Produk 1"));
  13.             j1 = parseInt(prompt("Masukkan Jumlah Produk 1"));
  14.             h2 = parseInt(prompt("Masukkan Harga Produk 2"));
  15.             j2 = parseInt(prompt("Masukkan Jumlah Produk 2"));
  16.             total = (h1 * j1) + (h2 * j2);
  17.             diskon = (total >= 50000) && (total * (10 / 100));
  18.  
  19.             document.write("<h1>Transaksi Penjualan</h1>");
  20.             document.write("<br/>Harga Produk 1 : Rp.", h1);
  21.             document.write("<br/>Jumlah Produk 1 : ", j1, " Buah");
  22.             document.write("<br/>Harga Produk 2 : Rp.", h2);
  23.             document.write("<br/>Jumlah Produk 2 : ", j2, " Buah");
  24.             document.write("<br/>Total Harga : Rp.", total);
  25.             document.write("<br/>Besar Diskon : Rp.", diskon);
  26.             document.write("<br/>Jumlah yang harus dibayarkan : Rp.", total - diskon);
  27.         </script>
  28.     </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment