Advertisement
X-88

koreksibakulkopi.py

Nov 9th, 2021 (edited)
642
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2. permasalahan kamu:
  3. 1. ident yg keluar lingkup
  4. 2. kehilangan beberapa tanda petik
  5. 3. opsi "c" ganda yg seharusnya "d"
  6. 4. tdk ada penentu diskon pada opsi "d"
  7. """
  8.  
  9.  
  10. pmenu =  ("==================================\n" +
  11.          "         WARKOP PDI \n" +
  12.          "List Menu Minuman Kopi\n" +
  13.          "A. Es Kopi Susu : Rp 11.000\n" +
  14.          "B. Es Kopi Coklat : Rp 12.000\n" +
  15.          "C. Es Kopi Hitam : Rp 11.000\n" +
  16.          "D. Es Cappucino : Rp 13.000\n" +
  17.          "==================================")
  18.  
  19.  
  20. pilihan = "y"
  21. while pilihan == "y":
  22.     print(pmenu)
  23.     pesan = input("Masukkan List Menu Kopi: ").lower()
  24.     jumlahpesan = int(input("Masukkan Jumlah Pesanan: "))
  25.     if pesan == "a":
  26.         listnama = "Es Kopi Susu"
  27.         harga = (11000 * jumlahpesan)
  28.         ppn = int(harga * 0.1)
  29.         if jumlahpesan >= 5:
  30.             diskon = int(harga * 0.2)
  31.             totalharga = int(harga - diskon + ppn)
  32.         else:
  33.             diskon = (0)
  34.             totalharga = int(harga+ppn)
  35.     elif pesan == "b":
  36.         listnama = "Es Kopi Coklat"
  37.         harga = (12000 * jumlahpesan)
  38.         ppn = int(harga * 0.1)
  39.         if jumlahpesan >= 5:
  40.             diskon = int(harga * 0.2)
  41.             totalharga = int(harga - diskon + ppn)
  42.         else:
  43.             diskon = (0)
  44.             totalharga = int(harga + ppn)
  45.     elif pesan == "c":
  46.         listnama= "Es Kopi Hitam"
  47.         harga = int(11000*jumlahpesan)
  48.         ppn = int(harga * 0.1)
  49.         if jumlahpesan >= 5:
  50.             diskon = int(harga * 0.2)
  51.             totalharga = int(harga - diskon + ppn)
  52.         else:
  53.             diskon(0)
  54.             totalharga = int(harga+ppn)
  55.     elif pesan == "d":
  56.         listnama = "Es Cappucino"
  57.         harga = int(13000 * jumlahpesan)
  58.         ppn = int(harga * 0.1)
  59.         if jumlahpesan >= 5:
  60.             diskon = 0
  61.             totalharga = int(harga + ppn)
  62.         else:
  63.             diskon(0)
  64.             totalharga = int(harga+ppn)
  65.     else:
  66.         listnama = "-"
  67.         harga = "-"
  68.         ppn = "-"
  69.         diskon = "-"
  70.         pilihan = input("Menu tidak tersedia, silahkan masukkan abjad menu yang tersedia dan ulangi Y/N")
  71.     print(' ================================= ')
  72.     print(' WARKOP PDI ')
  73.     print(' ================================= ')
  74.     print("Menu :",listnama )
  75.     print("Jumlah Pesan :", jumlahpesan )
  76.     print("Harga :", harga )
  77.     print("Diskon :", diskon )
  78.     print("PPN :", ppn )
  79.     print(" =============================== " )
  80.     pilihan = input("apakah anda ingin kembali Y/N? ").lower()
  81.  
  82.  
  83.  
Advertisement
RAW Paste Data Copied
Advertisement