akbarbasya26

ANUAN

Oct 7th, 2019
140
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <stdlib.h>
  3. using namespace std;
  4.  
  5. int main(){
  6. int menu, banyak, total_menu, total, uang_bayar, kembalian, diskon;
  7. cout << "Menu Kantin Univ Mercu Buana" << endl;
  8. cout << "1.) Ayam Geprek + Nasi + Es Susu Milo ( Rp. 15.000 )" << endl;
  9. cout << "2.) Ayam Penyet + Nasi + Es Teh ( Rp. 13.000 )" << endl;
  10. cout << "3.) Ayam Crispy + Nasi + Pepsi Dingin ( Rp. 14.000 )" << endl;
  11. cout << "4.) Ayam Bakar + Nasi Uduk + Es Teh ( Rp. 16.000 )" << endl;
  12. cout << "# Pilih Menu : "; cin >> menu;
  13. switch(menu){
  14. case 1:
  15. cout << "==========================================================================" << endl;
  16. cout << "[!] Kamu Memesan Paket 1 : Ayam Geprek + Nasi + Es Susu Milo ( Rp. 15.000 )" << endl;
  17. cout << "[T] Masukkan Jumlah Pesanan : "; cin >> banyak;
  18. total_menu = banyak * 15000;
  19. break;
  20. case 2:
  21. cout << "==========================================================================" << endl;
  22. cout << "[!] Kamu Memesan Paket 2 : Ayam Penyet + Nasi + Es Teh ( Rp. 13.000 )" << endl;
  23. cout << "[T] Masukkan Jumlah Pesanan : "; cin >> banyak;
  24. total_menu = banyak * 13000;
  25. break;
  26. case 3:
  27. cout << "==========================================================================" << endl;
  28. cout << "[!] Kamu Memesan Paket 3 : Ayam Crispy + Nasi + Pepsi Dingin ( Rp. 14.000 )" << endl;
  29. cout << "[T] Masukkan Jumlah Pesanan : "; cin >> banyak;
  30. total_menu = banyak * 14000;
  31. break;
  32. case 4:
  33. cout << "==========================================================================" << endl;
  34. cout << "[!] Kamu Memesan Paket 4 : Ayam Bakar + Nasi Uduk + Es Teh ( Rp. 16.000 )" << endl;
  35. cout << "[T] Masukkan Jumlah Pesanan : "; cin >> banyak;
  36. total_menu = banyak * 16000;
  37. break;
  38. default:
  39. cout << "Mohon Pilih Pesanan" << endl;
  40. exit (EXIT_FAILURE);
  41. break;
  42. }
  43. if(banyak > 5){
  44. total = total_menu * 0.2;
  45. diskon = total_menu - total;
  46. cout << "[+] Total : " << total_menu << endl;
  47. cout << "[!] Kamu mendapat diskon Rp." << total << endl;
  48. cout << "[+] Total Yang Harus Kamu Bayarkan adalah Rp." << diskon << endl;
  49. cout << "[R] Masukkan Uang Bayar : "; cin >> uang_bayar;
  50. }else if(banyak >= 3 && banyak <= 5){
  51. total = total_menu * 0.1;
  52. diskon = total_menu - total;
  53. cout << "[+] Total : " << total_menu << endl;
  54. cout << "[!] Kamu mendapat diskon Rp." << total << endl;
  55. cout << "[+] Total Yang Harus Kamu Bayarkan adalah Rp." << diskon << endl;
  56. cout << "[R] Masukkan Uang Bayar : "; cin >> uang_bayar;
  57. }else{
  58. diskon = total_menu;
  59. cout << "[+] Total Yang Harus Kamu Bayarkan adalah Rp." << diskon << endl;
  60. cout << "[R] Masukkan Uang Bayar : "; cin >> uang_bayar;
  61. }
  62. kembalian = uang_bayar - diskon;
  63. if(kembalian == 0){
  64. cout << "[T] Uang Bayar mu senilai Rp." << uang_bayar << endl;
  65. }else{
  66. cout << "[T] Uang Bayar mu senilai Rp." << uang_bayar << endl;
  67. cout << "[!] Kembalian mu senilai Rp." << kembalian << endl;
  68. }
  69. cout << "[!] Terima Kasih Telah Berkunjung!" << endl;
  70. cout << "==========================================================================" << endl;
  71. return 0;
  72. }
RAW Paste Data