#include<constrea.h>
#include<stdio.h>
class jual
{
public:
char kode_hp[5],*merk_hp;
int jml_beli;
float harga,total;
};
main()
{
char nm_kasir[25],nm_pembeli[25];
int i,j;
float totbay;
jual hp[10];
clrscr();
cout<<" CEMPEDAK CELL "<<endl;
cout<<" Jl. Cempedak no.378 "<<endl;
cout<<" Telp. (021) 7901074 "<<endl;
cout<<"-------------------------------------------------------------"<<endl;
cout<<"Nama kasir : ";gets(nm_kasir);
cout<<"Nama pembeli : ";gets(nm_pembeli);
cout<<"Masukkan jumlah data : ";cin>>j;
cout<<endl;
for(i=1;i<=j;i++)
{
cout<<"Data ke- "<<i<<endl;
cout<<"Kode Hp [NK66,SE80,NK73,SM73] :";cin>>hp[i].kode_hp;
if(strcmpi(hp[i].kode_hp,"NK66")==0)
{hp[i].merk_hp="Nokia 6600";
hp[i].harga=1200000;}
else
if(strcmpi(hp[i].kode_hp,"SE80")==0)
{hp[i].merk_hp="Sony Ericson W80";
hp[i].harga=1500000;}
else
if(strcmpi(hp[i].kode_hp,"NK73")==0)
{hp[i].merk_hp="Nokia N73";
hp[i].harga=1700000;}
else
if(strcmpi(hp[i].kode_hp,"SM73")==0)
{hp[i].merk_hp="Siemens C73";
hp[i].harga=1700000;}
cout<<"Merk Hp :"<<hp[i].merk_hp<<endl;
cout<<"Harga :Rp."<<setprecision(12)<<hp[i].harga<<endl;
cout<<"Jumlah beli :";cin>>hp[i].jml_beli;
hp[i].total=hp[i].jml_beli*hp[i].harga;
cout<<endl;
}
clrscr();
cout<<" COUNTER HANDPHONE CEMPEDAK CELL "<<endl;
cout<<" Laporan Penjualan Handphone "<<endl;
cout<<" Jl. Cempedak no. 378 Telp.(021)7901074 "<<endl;
cout<<"-------------------------------------------------------------"<<endl;
cout<<"No. Kode Merk Harga Jumlah Total "<<endl;
cout<<" HP HP Beli "<<endl;
cout<<"-------------------------------------------------------------"<<endl;
for(i=1;i<=j;i++)
{
cout<<setiosflags(ios::left)<<setw(5)<<i;
cout<<setiosflags(ios::left)<<setw(9)<<hp[i].kode_hp;
cout<<setiosflags(ios::left)<<setw(10)<<hp[i].merk_hp;
cout<<setiosflags(ios::right)<<setw(10)<<hp[i].harga;
cout<<setiosflags(ios::right)<<setw(10)<<hp[i].jml_beli;
cout<<setiosflags(ios::right)<<setw(10)<<hp[i].total<<endl;
totbay=totbay+hp[i].total;
}
cout<<"-------------------------------------------------------------"<<endl;
cout<<"Total Bayar :"<<setprecision(12)<<totbay<<endl;
getch();
}
akhirnya kelar juga klo ada yang mw coba di RUN,silahkan dulu download kerjaan di atas
0 komentar:
Posting Komentar