Listing Program
#include <iostream>
using namespace std;
int main()
{
char nama,*jenis;
long int kode,jumlah,harga,subtotal,total,ubay,diskon,ukem;
cout <<" DAFTAR MENU TOKO KUE FUJI ASTUTI "<<endl;
cout <<"-----------------------------------------------------------"<<endl;
cout <<"kode Daftar Kue Harga kue"<<endl;
cout <<"1 Bolu Black Forest Rp. 60.000 "<<endl;
cout <<"2 Chesse cake Rp. 45.000 "<<endl;
cout <<"3 Banana cake Rp. 25.500 "<<endl;
cout <<"4 strawberry cake Rp. 35.000 "<<endl;
cout <<"-----------------------------------------------------------"<<endl;
cout <<" rincian rental "<<endl;
cout <<"-----------------------------------------------------------"<<endl;
cout <<"Nama Pemmbeli = ";cin>>nama;
cout <<"Kode kue (1/2/3/4) = ";cin>>kode;
switch (kode)
{
case 1:
jenis="Bolu Black Forest";
harga=60000;
break;
case 2:
jenis="Chesse Cake";
harga=45000;
break;
case 3:
jenis="Banana Cake";
harga=25500;
break;
case 4:
jenis="Strawberry Cake";
harga=35000;
break;
default :
cout<<" = menu yang anda maksud tidak tersedia";
return 0;
}
cout <<"jenis Kue = "<<jenis<<endl;
cout <<"harga per kue = Rp."<<harga<<endl;
cout <<"jumlah kue = ";cin>>jumlah;
subtotal = harga*jumlah;
cout <<"Sub Total = Rp."<<subtotal<<endl;
if (jumlah >=20)
diskon= (20*subtotal)/100;
if (jumlah >=10)
diskon= (5*subtotal)/100;
else
diskon = 0;
cout <<"Diskon = Rp."<<diskon<<endl;
total=subtotal-diskon;
cout <<"Total Bayar = Rp."<<total<<endl;
cout <<"-----------------------------------------------------------"<<endl;
return 0;
}
Comments
Post a Comment