Saturday, November 2, 2013

c++ program penjualan baju

#include<iostream.h>
#include<conio.h>
#include<stdio.h>

main()
{
char kode[6],*merk,ukuran,nm_pmbl[20],no[15];
long harga,jml,total,kembali,byr;

cout<<"\t\tJAKET SERBA NYAMAN \n";
cout<<"==================================================="<<endl;
cout<<"Nama pembeli : ";cin>>nm_pmbl;
gotoxy(35,3);
cout<<"no.tlp: ";cin>>no;

cout<<"==================================================="<<endl;
cout<<"Pilihan kode jaket :\n";
cout<<"1 kode jaket eiger \n";
cout<<"2 kode jaket polo \n";
cout<<"==================================================="<<endl;
cout<<"Kode jaket   : ";cin>>kode;
cout<<"Ukuran[s/m/l]: ";cin>>ukuran;
cout<<"Jumlah Beli  : ";cin>>jml;
if (kode=="1")
{
        merk="Eiger";
         if (ukuran=='s' || 'S')
            harga=150000;
      else if    (ukuran=='m' || 'M')
             harga=220000;
          else
              harga=250000;
}
else
{
        merk="Polo";
        if (ukuran=='s'||'S')
          harga=100000;
      else if    (ukuran=='m' || 'M')
                harga=150000;
            else
             harga=200000;
}

cout<<"Merek Barang : "<<merk<<endl;
cout<<"Harga Barang : "<<harga<<endl;
total=jml*harga;
cout<<"Total Bayar  : "<<total<<endl;
cout<<"Bayar        : ";cin>>byr;
kembali=byr-total;
cout<<"Kembali      : "<<kembali<<endl;
cout<<"==================================================="<<endl;
getch();
}

1 comment: