#include <stdio.h>
#include <conio.h>
#include <iostream.h>
judul()
{
cout<<"\t\t\t Toko Buah \"FRUITY FRESH\" "<<endl;
puts("\t\t\t *=*=*=*=*=*=*=*=*=*=*");
}
long kembalian(long ubay,long totbay);
main()
{
char notrans[15],kodkas[2],kodbuah,kasir[20],buah[20];
int jumbel;
long harga,totbay=0,ubay,ukem,jumha;
clrscr();
judul();
cout<<"Input No Transaksi : ";cin>>notrans;
cout<<"Input Kode Kasir[BM/RG/DR] : ";cin>>kodkas;
puts("==============================================================");
cout<<"Pilih Kode Buah [A/L/J] : ";cin>>kodbuah;
cout<<"Input Jumlah Beli : ";cin>>jumbel;
if(!strcmp(kodkas,"BM")||!strcmp(kodkas,"bm"))
{
strcpy(kasir,"Bima");
if(kodbuah=='A'||kodbuah=='a')
{
strcpy(buah,"Apel Fuji");
harga=35000;
}
else if(kodbuah=='L'||kodbuah=='l')
{
strcpy(buah,"Lengkeng Bangkok");
harga=25000;
}
else
{
strcpy(buah,"Jeruk Sunkist");
harga=30000;
}
}
else if(!strcmp(kodkas,"RG")||!strcmp(kodkas,"rg"))
{
strcpy(kasir,"Rangga");
if(kodbuah=='A'||kodbuah=='a')
{
strcpy(buah,"Apel Fuji");
harga=35000;
}
else if(kodbuah=='L'||kodbuah=='l')
{
strcpy(buah,"Lengkeng Bangkok");
harga=25000;
}
else
{
strcpy(buah,"Jeruk Sunkist");
harga=30000;
}
}
else if(!strcmp(kodkas,"DR")||!strcmp(kodkas,"dr"))
{
strcmp(kasir,"Dira");
if(kodbuah=='A'||kodbuah=='a')
{
strcpy(buah,"Apel Fuji");
harga=35000;
}
else if(kodbuah=='L'||kodbuah=='l')
{
strcpy(buah,"Lengkeng Bangkok");
harga=25000;
}
else
{
strcpy(buah,"Jeruk Sunkist");
harga=30000;
}
}
clrscr();
cout<<"\t\t\t Struck Pembelian Buah"<<endl;
judul();
cout<<"Nota : "<<notrans<<ends<<ends<<ends<<ends<<ends<<ends<<ends<<ends<<" Nama Kasir : "<<kasir<<endl;
puts("================================================================================");
cout<<"Buah Yang Dibeli : "<<buah<<endl;
cout<<"Harga Per KG : "<<harga<<endl;
cout<<"Jumlah Beli : "<<jumbel<<endl;
jumha=harga*jumbel;
cout<<"Jumlah Harga : "<<jumha<<endl;
totbay=totbay+jumha;
cout<<"Total Bayar : "<<totbay<<endl;
cout<<"Uang Bayar : ";cin>>ubay;
ukem=kembalian(ubay,totbay);
cout<<"Uang Kembali : "<<ukem<<endl;
getch();
}
long kembalian(long ubay,long totbay)
{
return(ubay-totbay);
}
Dijamin Running & Jangan Lupa Coment ya :)
Tidak ada komentar:
Posting Komentar