Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--Indonesian C0der Leak-->
- <!--Created By : Ilham Wicaksono :)-->
- <html>
- <head>
- <title>Transaksi Penjualan</title>
- </head>
- <body>
- <script type="text/javascript">
- var h1,j1,h2,j2,total,diskon;
- h1 = parseInt(prompt("Masukkan Harga Produk 1"));
- j1 = parseInt(prompt("Masukkan Jumlah Produk 1"));
- h2 = parseInt(prompt("Masukkan Harga Produk 2"));
- j2 = parseInt(prompt("Masukkan Jumlah Produk 2"));
- total = (h1 * j1) + (h2 * j2);
- diskon = (total >= 50000) && (total * (10 / 100));
- document.write("<h1>Transaksi Penjualan</h1>");
- document.write("<br/>Harga Produk 1 : Rp.", h1);
- document.write("<br/>Jumlah Produk 1 : ", j1, " Buah");
- document.write("<br/>Harga Produk 2 : Rp.", h2);
- document.write("<br/>Jumlah Produk 2 : ", j2, " Buah");
- document.write("<br/>Total Harga : Rp.", total);
- document.write("<br/>Besar Diskon : Rp.", diskon);
- document.write("<br/>Jumlah yang harus dibayarkan : Rp.", total - diskon);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment