C++ Menghitung Harga Menu

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 19, 2016





gambar di samping digunakan ketika kita ingin menghitung harga suatu menu dan discount yang diperoleh. selamat mencoba ya.

 #include <iostream>
using namespace std;
main()
{
int menu;
long int harga, total, cml;
cout<<"********FRESH********"<<endl;
cout<<"1.Juice"<<endl;
cout<<"2.Softdrink"<<endl;
cout<<"3.Milk Shake"<<endl;
cout<<"4.Tiramisu"<<endl;
cout<<"5.Cookies Cream"<<endl;
 cout<<"Masukan Fresh Menu Yang Ingin Anda Pesan [1/2/3/4/5]=";
 cin>>menu;
 switch(menu)
 {
  case 1:
      harga=10000;
   cout<<"Juice"<<endl;
   cout<<"Harga = 10000"<<endl;
   cout<<"Jumlah Beli = ";
   cin>>cml;
   total=harga*cml;
   if(cml>=2)
    {
        total= total-(total*10/100);
    }
    else if (cml<2)
        {
            total=harga*cml;
        }
   cout<<"Total Harga Uang Harus Dibayar ="<<total;
  break;
  case 2:
   harga=15000;
   cout<<"Soft Drink"<<endl;
   cout<<"Harga = 15000"<<endl;
   cout<<"Jumlah Beli = ";
   cin>>cml;
   total=harga*cml;
   if(cml>=2)
    {
        total= total-(total*10/100);
    }
    else if (cml<2)
        {
            total=harga*cml;
        }
   cout<<"Total Harga Uang Harus Dibayar ="<<total;
  break;
  case 3:
      harga=20000;
   cout<<"Milk Shake"<<endl;
   cout<<"Harga = 20000"<<endl;
   cout<<"Jumlah Beli = ";
   cin>>cml;
   total=harga*cml;
   if(cml>=2)
    {
        total= total-(total*10/100);
    }
    else if (cml<2)
        {
            total=harga*cml;
        }
   cout<<"Total Harga Uang Harus Dibayar ="<<total;
  break;
  case 4:
      harga=18000;
   cout<<"Cookies Cream"<<endl;
   cout<<"Harga = 18000"<<endl;
   cout<<"Jumlah Beli = ";
   cin>>cml;
   total=harga*cml;
   if(cml>=2)
    {
        total= total-(total*10/100);
    }
    else if (cml<2)
        {
            total=harga*cml;
        }
   cout<<"Total Harga Uang Harus Dibayar ="<<total;
  break;
        case 5:
            harga=16000;
   cout<<"Cookies Cream"<<endl;
   cout<<"Harga = 16000"<<endl;
   cout<<"Jumlah Beli = ";
   cin>>cml;
   total=harga*cml;
   if(cml>=2)
    {
        total= total-(total*10/100);
    }
    else if (cml<2)
        {
            total=harga*cml;
        }
   cout<<"Total Harga Uang Harus Dibayar ="<<total;
  break;
 default:
  cout<<"Pesanan Tidak Tersedia Di Menu";
 break;
 }
}




Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed