Borland C++ Tipe B


#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<iomanip.h>
line1()
{
cout<<“=============================================”<<endl;
}

line2()
{
cout<<“=============================”<<endl;
}

main()
{
class
{
public:
char nm[20];
long int harga,tohar;
int jumbel;
}penj[10];
float subtotal=0,diskon,ppn,grand,bayar,kembali;
char nota;
int i,j;

clrscr();
line1();
cout<<”          SWALAYAN BINA DAGANG”<<endl;
line1();
cout<<“No. Nota             : “;cin>>nota;
cout<<“Jumlah Transaksi     : “;cin>>j;
for(i=1;i<=j;i++)
{
cout<<endl;
cout<<“Transaksi ke -“<<i<<endl;
cout<<“Nama Barang       : “;gets(penj[i].nm);
cout<<“Harga Satuan      : “;cin>>penj[i].harga;
cout<<“Jumlah Beli       : “;cin>>penj[i].jumbel;
penj[i].tohar=penj[i].harga*penj[i].jumbel;
cout<<“Total Harga       : “<<penj[i].tohar;
subtotal=subtotal+penj[i].tohar;
if(subtotal>180000)
{diskon=0.15*subtotal;}
else if(subtotal>70000)
{diskon=0.05*subtotal;}
else
{diskon=0;}
ppn=0.1*(subtotal-diskon);
grand=(subtotal-diskon)+ppn;
}

clrscr();
cout<<”    SWALAYAN BINA DAGANG”<<endl;
cout<<” Jl. Bina Sarana No. 851-OK”<<endl<<endl;
cout<<“Nama Brg    @Harga  Jml Beli”<<endl;
line2();
for(i=1;i<=j;i++)
{
cout<<setiosflags(ios::left)<<setw(12)<<penj[i].nm;
cout<<setiosflags(ios::left)<<setw(8)<<penj[i].harga;
cout<<setiosflags(ios::left)<<setw(8)<<penj[i].jumbel<<endl;
}
line2();
cout<<”   Subtotal : Rp.”<<subtotal<<endl;
cout<<”     Diskon : Rp.”<<diskon<<endl;
cout<<”    PPN 10% : Rp.”<<ppn<<endl;
cout<<“Grand Total : Rp.”<<grand<<endl;
cout<<”      Bayar : Rp.”;cin>>bayar;
cout<<endl;
kembali=bayar-grand;
cout<<”  Kembalian : Rp.”<<kembali<<endl<<endl<<endl;
cout<<”     Terima Kasih Atas”<<endl;
cout<<”      Kunjungan Anda “<<endl;
getch();
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: