Unknown
#include <constrea>
#include <stdio>
#include <iomanip.h>

main()
{
int bj,j;
char kenis[10][50],kode[50];
int hrg[50],byk[50],jumhar[50],jumbay=0,pjk,tot;
clrscr();
cout<<" GEROBAK FRIED CHICKEN\n";
cout<<"-----------------------\n";
cout<<"Kode Jenis Harga\n";
cout<<"-----------------------\n";
cout<<" D Dada Rp.2500\n";
cout<<" P Paha Rp.2000\n";
cout<<" S Sayap Rp.1500\n";
cout<<"-----------------------\n\n";
cout<<"Banyak jenis :";cin>>bj;
for (j=1;j<=bj;j++)
{

cout<<"Jenis Ke -"<<j<<endl;
cout<<"Jenis Potong [D/P/S] :";cin>>kode[j];
cout<<"Banyak Potong :";cin>>byk[j];

if (kode[j]=='D'||kode[j]=='d')
{ strcpy(jenis[j],"Dada");
hrg[j]=2500;}
else if (kode[j]=='P'||kode[j]=='p')
{strcpy(jenis[j],"Paha");
hrg[j]=2000;}
else if (kode[j]=='S'||kode[j]=='s')
{strcpy(jenis[j],"Sayap");
hrg[j]=1500;}
else
{strcpy(jenis[j],"-");
hrg[j]=0;}



jumhar[j]=hrg[j]*byk[j];
jumbay=jumbay+jumhar[j];
pjk=(jumbay*10)/100;
tot=jumbay-pjk;
cout<<endl;
}
cout<<" GEROBAK FRIED CHICKEN\n";
cout<<"-------------------------------------------------\n";
cout<<"No. Jenis Harga Banyak Jumlah \n";
cout<<" Potong Satuan Beli Harga \n";
cout<<"-------------------------------------------------\n";
for (j=1;j<=bj;j++)
{
cout<<setiosflags(ios::left)<<setw(4)<<j;
cout<<setiosflags(ios::left)<<setw(12)<<kode[j];
cout<<setiosflags(ios::left)<<setw(11)<<hrg[j];
cout<<setiosflags(ios::left)<<setw(11)<<byk[j];
cout<<setiosflags(ios::left)<<setw(11)<<jumhar[j]<<endl;
}
cout<<"\n-------------------------------------------------\n";
cout<<endl;
cout<<" Jumlah Bayar Rp. "<<jumbay<<endl;
cout<<" Pajak 10% Rp. "<<pjk<<endl;
cout<<" Total Bayar Rp. "<<tot<<endl;



getch();
}
0 Responses

Posting Komentar