#include <conio.h>
#include <iostream.h>
main()
{
char nmpembeli[20],kdkue,*nmkue,atas,bawah,lagi;
long int hrgkue,byr,ubyr,totbay,kembali;
float ppn;
int jmlkue;
atas:
cout<<""<<endl;
cout<<" DAFTAR MENU TOKO KUE ^NIKMAT^"<<endl;
cout<<" 1. Bolu Black Forest"<<endl;
cout<<" 2. Cheese Cake"<<endl;
cout<<" 3. Banana Cake"<<endl;
cout<<" 4. Strawbery Cake"<<endl;
cout<<" "<<endl;
cout<<" Nama Pembeli\t\t= ";gets(nmpembeli);
cout<<" =================================== "<<endl;
cout<<" Kode Kue[1/2/3/4]\t= ";cin>>kdkue;
cout<<" Jumlah Kue\t\t= ";cin>>jmlkue;
if(kdkue=='1')
{nmkue="Bolu Black Forest";
hrgkue=60000;}
else
if(kdkue=='2')
{nmkue="Cheese Cake";
hrgkue=45000;}
else
if(kdkue=='3')
{nmkue="Banana Cake";
hrgkue=25500;}
else
{nmkue="Strawbery Cake";
hrgkue=35000;}
clrscr();
cout<<""<<endl;
cout<<" TOKO KUE ^NIKMAT^"<<endl;
cout<<" Struk Pembayaran"<<endl;
cout<<" - - - - - - - - - - - - - - - - - - - - - "<<endl;
cout<<" Nama Pembeli\t= "<<nmpembeli<<endl;
cout<<" Kode Kue\t= "<<kdkue<<endl;
cout<<" Nama Kue\t= "<<nmkue<<endl;
cout<<" Harga Kue\t= Rp."<<hrgkue<<endl;
cout<<" Jumlah Kue\t= "<<jmlkue<<endl;
cout<<" =================================== "<<endl;
byr=jmlkue*hrgkue;
cout<<" Jumlah Bayar\t= Rp."<<byr<<endl;
ppn=0.25*byr;
cout<<" Ppn\t\t= Rp."<<ppn<<endl;
totbay=ppn+byr;
cout<<" Total Bayar\t= Rp."<<totbay<<endl;
cout<<" Uang Bayar\t= Rp.";cin>>ubyr;
kembali=ubyr-byr;
cout<<" Kembali\t= Rp."<<kembali<<endl;
cout<<""<<endl;
cout<<" Terima Kasih Atas Kunjungannya "<<endl;
cout<<" Input Lagi [Y/T]? ";cin>>lagi;
clrscr();
if (lagi=='Y'||lagi=='y')
goto atas;
else
goto bawah;
bawah:
getch();
}
Hasil Program
Tidak ada komentar:
Posting Komentar