• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

yofikur Nov 26th, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. <?php
2.
3. \$nama_brg = ["Kulkas", "Laptop"];
4. \$hrg_satuan = [1500000,3500000];
5. \$jmlh_beli = [55,55];
6. \$diskon =5/100;
7. \$sts_beli ="Member";
8. \$total_jmlh =array_sum(\$jmlh_beli);
9.
10. //output
11. print("MINIMARKET ONLINE <br>");
12. print("--------------------------------------------------------------------<br>");
13. print("| No | &nbsp | Nama Barang | &nbsp | Harga Satuan | &nbsp | Jumlah |<br>");
14. print("--------------------------------------------------------------------<br>");
15.
16. \$x=0;
17. \$no=1;
18. for(\$i=0; \$i<count (\$jmlh_beli); \$i++)
19.     {
20.         \$total[\$i]=\$jmlh_beli[\$i]*\$hrg_satuan[\$i];
21.         print(" &nbsp&nbsp \$no  &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp \$nama_brg[\$x]   &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp \$hrg_satuan[\$x] &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp \$jmlh_beli[\$x]<br>");
22.         \$x++;
23.         \$no++;
24.     }
25. \$total_hrg =array_sum(\$total);
26. \$pot =\$diskon*\$total_hrg;
27.
28. if((\$total_jmlh >= 100)and(\$sts_beli=="Member"))
29.     {
30.         \$bnyk_dis ="5%";
31.         \$bayar =\$total_hrg-\$pot;
32.     }
33. else
34.     {
35.         \$bnyk_dis ="-";
36.         \$bayar =\$total_hrg;
37.     }
38.
39. print("--------------------------------------------------------------------<br>");
40. print("Total Harga  :\$total_hrg<br>");
41. print("--------------------------------------------------------------------<br>");
42. print("Status Pembeli   :\$sts_beli<br>");
43. print("Besar Diskon = \$bnyk_dis<br>");
44. print("--------------------------------------------------------------------<br>");
45. print("Total yang Harus Dibayar :\$bayar<br>");
46. print("--------------------------------------------------------------------<br>");
47.
48. ?>
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.
Not a member of Pastebin yet?