Rabu, 22 Oktober 2014

Listing Program Jaket Serba Nyaman "c++"



“JAKET SERBA NYAMAN”


Ketentuan soal :
Kode   Merk   Ukuran    Harga

1          Eiger       S           150.000
                            M          220.000
                            L           250.000
2          Polo        S           100.000
                             M            150.000
                            L           200.000 

  
 //*Program Penjualan Jaket Serba Nyaman*//


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

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

cout<<"\t\tJAKET SERBA NYAMAN \n";
cout<<"==================================================="<<endl;
cout<<"Nama pembeli : ";gets(nm);
gotoxy(35,3);
cout<<"no.tlp: ";cin>>no;
cout<<"==================================================="<<endl;
cout<<"Pilihan kode jaket :\n";
cout<<"1-untuk kode jaket Eiger \n";
cout<<"2-untuk 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();
}

                                                                                  
                                                                                      



Tidak ada komentar:

Posting Komentar