#include,conio.h,
#include,stdio.h,
#include,iostream.h,
#include,iomanip.h,
main()
{
int x,y;
char lagi,kd[3],*makanan[20];
long int hrg[5],jml[5],total[5],ttl=0,ubay,ukem;
atas:
clrscr();
cout<<"=========================================",,endl; cout<<"\tRESTORAN SIAP SAJI TAMA",,endl; cout<<"=========================================",,endl; cout<<" KODE NAMA HARGA",,endl; cout<<"MAKANAN MAKANAN",,endl; cout<<"=========================================",,endl; cout<<"A Ayam Bakar Rp.8.000",,endl; cout<<"T Tuna Pedas Rp.6.500",,endl; cout<<"D Dendeng Goreng Rp.9.000",,endl; cout<<"=========================================",,endl; cout<<"Silahkan Masukkan Pesanan:";cin>>y;
for(x=1;x<=y;x++) { cout<<"Pesanan Ke-",,x,,endl; cout<<"Silahkan Masukkan Kode Makanan:";cin>>kd[x];
if(kd[x]=='A')
{makanan[x]="Ayam Bakar";hrg[x]=8000;}
else if(kd[x]=='T')
{makanan[x]="Tuna Pedas";hrg[x]=6500;}
else
{makanan[x]="Dendeng Goreng";hrg[x]=9000;}
cout<<"Silahkan Masukkan JUmlah Beli:";cin>>jml[x];
total[x]=hrg[x]*jml[x];
cout,,endl;
}
clrscr();
cout<<"\t\tRESTORAN SIAP SAJI TAMA",,endl; cout<<"=======================================================",,endl; cout<<" KODE NAMA HARGA JUMLAH SUBTOTAL",,endl; cout<<"MAKANAN MAKANAN BELI ",,endl; cout<<"=======================================================",,endl; for(x=1;x<=y;x++) { cout,,setiosflags(ios::left),,setw(10),,kd[x]; cout,,setiosflags(ios::left),,setw(15),,makanan[x]; cout,,setiosflags(ios::left),,setw(10),,hrg[x]; cout,,setiosflags(ios::left),,setw(10),,jml[x]; cout,,setiosflags(ios::left),,setw(35),,total[x]; ttl=ttl+total[x]; } cout<<"=======================================================",,endl; cout<<"Total Keseluruhan:Rp.",,ttl,,endl; cout<<"Uang Bayar :Rp.";cin,,ubay; ukem=ubay-ttl; cout<<"Uang Kembali :Rp.",,ukem,,endl; cout<<"========================================================",,endl; cout<<"Apakah Anda Ingin Kembali Bertransaksi [y/t]:";cin>>lagi;
if(lagi=='y'||lagi=='Y')
goto atas;
else
goto bawah;
bawah:
getch();
}
(tolong ganti tanda ,, dengan << karena format tidak mendukung)
0 komentar:
Post a Comment