SHARE
TWEET

Untitled

yofikur Dec 3rd, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $Paket1 = ["A","B","C","D","E"];
  3. $makan  = ["Pecel Lele + Nasi","Pecel Lele + Nasi","Pecel Lele + Nasi","Pecel Lele + Nasi","Pecel Lele + Nasi"];
  4. $minum =  ["Teh + Jus","Teh + Jus","Teh + Jus","Teh + Jus","Teh + Jus"];
  5. $harga1 =  [15000,7000,25000,30000,30000];
  6. //output
  7. print("-------------------------------------------------------------------------<br>");
  8. print("|Paket |&nbsp Makan| &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Minum| &nbsp &nbsp &nbsp &nbsp |Harga|<br>");
  9. print("-------------------------------------------------------------------------<br>");
  10. // ohy
  11.     $i = 0;
  12.     for($i=0; $i<5; $i++) {
  13.        print("$Paket1[$i] &nbsp &nbsp &nbsp $makan[$i]&nbsp &nbsp &nbsp $minum[$i] &nbsp &nbsp &nbsp $harga1[$i]<br>");
  14.     }
  15.  
  16.  
  17.     $paket="D";
  18.     switch ($paket)
  19.      {
  20.         case 'A':
  21.             $makan="Pecel Lele + Nasi";
  22.             $minum="Jus + Air Putih";
  23.             $harga=15000;
  24.             break;
  25.         case 'B':
  26.             $makan="Mie Rebus + Nasi";
  27.             $minum="Air Putih";
  28.             $harga=7000;
  29.             break;
  30.         case 'C':
  31.             $makan="Gulai + Nasi";
  32.             $minum="Jus + Capucino";
  33.             $harga=25000;
  34.             break;
  35.         case 'D':
  36.             $makan="Lele + Nasi";
  37.             $minum="Teh + Jus";
  38.             $harga=30000;
  39.             break; 
  40.         case 'E':
  41.             $makan="Ayam + Nasi";
  42.             $minum="Teh + Jus";
  43.             $harga=30000;
  44.             break;             
  45.     }
  46.     print("-------------------------------------------------------------------------<br>");
  47.     print "Paket Pilihan Anda   : $paket <br>";
  48.     print "Makanan              : $makan <br>";
  49.     print "Minuman              : $minum <br>";
  50.     print "Harga Paket          : $harga <br>";
  51. ?>
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top