SHARE
TWEET

es krim

a guest Nov 22nd, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<iomanip>
  3. #include<stdlib.h>
  4. #include<string>
  5. using namespace std;
  6. int main(){
  7.     char ulang;
  8.     string es, nama;
  9.     int total, harga, pilih, jumlah, hasil, diskon, uang, kembalian;
  10.     mulai:
  11.     cout<<" CM ICECREAM"<<endl;
  12.     cout<<"======================="<<endl<<endl;
  13.     cout<<"input nama pembeli:";cin>>nama;cout<<endl;
  14.     cout<<"pilihan eskrim yang tersedia:"<<endl;
  15.     cout<<"1.chocolate strawberry"<<endl;
  16.     cout<<"2.chocolate vanila"<<endl;
  17.     cout<<"3.chocolate capucino"<<endl;
  18.     cout<<"es krim yang dipilih:";cin>>pilih;
  19.     switch(pilih){
  20.         case 1:
  21.             harga=15000;
  22.             es="chocolate strawberry";
  23.             break;
  24.         case 2:
  25.             harga=20000;
  26.             es="chocolate vanila";
  27.             break;
  28.         case 3:
  29.             harga=25000;
  30.             es="chocolate capucino";
  31.             break;
  32.     }
  33.     cout<<"jumlah beli:";cin>>jumlah;
  34.     cout<<"uang pembeli:";cin>>uang;
  35.     total=jumlah*harga;
  36.     if(total>50000){
  37.         diskon=total*0.10;
  38.     } else if(total>40000 && total<50000){
  39.         diskon=total*0.5;
  40.     }
  41.     hasil = total - diskon;
  42.     kembalian= uang - hasil;
  43.     system("cls");
  44.     cout<<"     Struk pembayaran"<<endl;
  45.     cout<<"========================"<<endl;
  46.     cout<<"Nama pembeli:"<<nama<<endl;
  47.     cout<<"Nama eskrim:"<<es<<endl;
  48.     cout<<"Harga:"<<harga<<endl;
  49.     cout<<"Jumlah:"<<jumlah<<endl;
  50.     cout<<"Total:"<<total<<endl;
  51.     cout<<"Potongan:"<<diskon<<endl;
  52.     cout<<"======================="<<endl;
  53.     cout<<"Total keseluruhan:"<<hasil<<endl;
  54.     cout<<"Uang bayar:"<<uang<<endl;
  55.     cout<<"Uang kembalian:"<<kembalian<<endl;
  56.     cout<<"mau input lagi (Y/N)?";cin>>ulang;
  57.     if(ulang=='Y' || ulang=='y'){
  58.         system("cls");
  59.         goto mulai;
  60.     }
  61. }
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