PEMBUKA

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Powered By Blogger
Powered By Blogger

Senin, 06 Oktober 2014

CARA MEMBUAT SIMULASI TOKO BUKU DENGAN MENGGUNAKAN BORALND C++




 CONTOH CODINGANYA



#include <iostream.h>

#include <conio.h>

main()

{



char kode, *namabuku, *bonus;

int jumbel, harga, jumbay, ttl, ttl_byr;

float potongan;

clrscr();



cout<<"MASUKAN KODE BUKU [1-4]       :";cin>>kode;

switch(kode)

{

   case '1' :

   cout<<"IMPIAN YANG BERAWAL DARI MIMPI";

   break;



   case '2' :

   cout<<"SEBUAH KISAH KLASIK UNTUK MASA DEPAN";

   break;



   case '3':

   cout<<"PENCARIAN TERAKHIR";

   break;



   case '4':

   cout<<"NEGRI DIATAS AWAN";

   break;



   default :

   cout<<"MAAF, ANDA SALAH MASUKAN KODE";

}



cout<<"\nJUMLAH PEMBELIAN BUKU ANDA    :";cin>>jumbel;

if(kode=='1')

{

namabuku="IMPIAN YANG BERAWAL DARI MIMPI";

harga=35000;

}

else if(kode=='2')

{

namabuku="SEBUAH KISAH KLASIK UNTUK MASA DEPAN";

harga=40000;

}

else if(kode=='3')

{

namabuku="PENCARIAN TERAKHIR";

harga=45000;

}
else if(kode=='4')

{

namabuku="NEGRI DIATAS AWAN";

harga=50000;

}

ttl=jumbel*harga;



if(jumbel>=8)

{

potongan=0.3*ttl;

bonus="SELAMAT ANDA MENDAPATKAN 1 BUAH NOVEL GRATIS";

}



else

{

potongan=0;

bonus="MAAF ANDA BELUM MENDAPATKAN BONUS";

}

ttl_byr=ttl-potongan;



clrscr();

cout<<"============================================================="<<endl;

cout<<"                       (((((TOKO BUKU WBS)))))"<<endl;

cout<<"               JLN.FLAMBOYAN, CISALAK PASAR KOTA DEPOK"<<endl;

cout<<"============================================================="<<endl;

cout<<"NAMA BUKU YANG ANDA BELI   :"<<namabuku<<endl;

cout<<"HARGA BUKU YANG ANDA BELI  :"<<harga<<endl;

cout<<"JUMLAH BUKU YANG ANDA BELI :"<<jumbel<<endl;

cout<<"TOTAL HARGA                :"<<ttl<<endl;

cout<<"POTONGAN HARGA             :"<<potongan<<endl;



cout<<"-------------------------------------------------------------"<<endl;

cout<<"TOTAL BAYAR                :"<<ttl_byr<<endl;

cout<<"BONUS YANG ANDA DAPATKAN   :"<<bonus<<endl;

cout<<"============================================================="<<endl;

cout<<"                       T E R I M A K A S I H"<<endl;

cout<<"                   TELAH BERKUNJUNG KE TOKO KAMI"<<endl;

cout<<"\nSampai Berjumpa Lagi"<<endl;

getch();
}


Contoh hasil input dan outputnya



cara input yang benar dan yang mendapatkan potongan harga
hasil output yang benar dan mendapakan potongan harga
contoh input yang benar tapi tidak mendapatkan potongan

 

  contoh output yang benar tapi tidak mendapatkan potongan
  contoh input yag salah 
contoh hasil output yang salah




Sekian pembahasan dari saya, semoga bermanfaat, sampai jumpa lagi #thanks





TV

    Warung Bebas TV Streaming

    Pengikut