Saturday, October 26, 2013

Borland C++ " TOKO CAKE SEJAHTERA"

Sobat Blogger , saya tampilkan contoh program sederhana dengan Borland C++ , kalau contoh berikut, judulnya "Toko Cake Sejahtera " , masih urusan jual beli he he he

Berikut listing programnya

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

void main()
{
char kd_roti,nm_customer[20],uk_roti,nm_ukuran[8],jns_roti[10],lagi;
int  harga_roti,jum_beli;
long uang_byr,uang_kembali,total;
awal:
cout<<"=================================================="<<endl;
cout<<"\tTOKO CAKE SEJAHTERA \n";
cout<<"=================================================="<<endl;
cout<<"Nama Customer : ";cin>>nm_customer;
cout<<"=================================================="<<endl;
cout<<"Kode Roti     :\n";
cout<<"\t\tT.ROTI TAWAR \n";
cout<<"\t\tI.ROTI ISI \n";
cout<<"\t\tB.ROTI BAKAR \n";
cout<<"==================================================="<<endl;
cout<<"\nKode Roti  [T/I/B]  : ";cin>>kd_roti;
cout<<"\nUkuran [1/2/3]      : ";cin>>uk_roti;

if (kd_roti=='T'||kd_roti=='t')
   {strcpy(jns_roti,"ROTI TAWAR");
         if (uk_roti== '1')
         {strcpy(nm_ukuran,"Besar");
       harga_roti=7000;}
      if (uk_roti=='2')
      {strcpy(nm_ukuran,"Sedang");
       harga_roti=5000; }
       if (uk_roti=='3')
       {strcpy (nm_ukuran,"Kecil");
       harga_roti=3000;}
       }

else if (kd_roti=='I'||kd_roti=='i')
   {strcpy(jns_roti,"ROTI ISI");
         if (uk_roti== '1')
         {strcpy(nm_ukuran,"Besar");
       harga_roti=10000;}
      if (uk_roti=='2')
      {strcpy(nm_ukuran,"Sedang");
       harga_roti=8000; }
       if (uk_roti=='3')
       {strcpy (nm_ukuran,"Kecil");
       harga_roti=6000;}
        }
else if (kd_roti=='B'||kd_roti=='b')
   {strcpy(jns_roti,"ROTI BAKAR");
         if (uk_roti== '1')
         {strcpy(nm_ukuran,"Besar");
       harga_roti=11000;}
      if (uk_roti=='2')
      {strcpy(nm_ukuran,"Sedang");
       harga_roti=9000; }
       if (uk_roti=='3')
       {strcpy (nm_ukuran,"Kecil");
       harga_roti=7000;}
       }
       clrscr();

cout<<"=========================================="<<endl;
cout<<"\tTOKO CAKE SEJAHTERA \n";
cout<<"=========================================="<<endl;
cout<<"Nama  Customer : "<<nm_customer<<endl;
cout<<"Kode Roti      : "<<kd_roti<<endl;
cout<<"Jenis Roti     : "<<jns_roti<<endl;
cout<<"Ukuran Roti    : "<<nm_ukuran<<endl;
cout<<"Harga Satuan   : "<<harga_roti<<endl;
cout<<"=========================================="<<endl;
cout<<"Jumlah Beli    : ";cin>>jum_beli;
total=jum_beli*harga_roti;
cout<<"Total          : "<<total;
cout<<"\nUang Bayar     : ";cin>>uang_byr;
uang_kembali=uang_byr-total;
cout<<"\nUang Kembali   : "<<uang_kembali;
cout<<"\n=========================================="<<endl;

cout<<"\nINGIN INPUT LAGI [Y/T] : "; cin>>lagi;
if (lagi == 'y' || lagi =='Y')
goto awal;
getch();
}

Hasil dari listing program terebut di atas setelah di run menjadi

Layar Input dan Layar Output



Begitulah kira-kira contoh listing program dan hasilnya yang bisa saya tampilkan .
Jika ada salah ,mohon komennya agar bisa diperbaiki kembali , terima kasih

Jakarta , 26 Oktober 2013

1 comment:

Analisis dan Perancangan Topologi Jaringan Fiber Optik di Perusahaan Provider BUMN

Hello World; Siang Fans, Please Say Hello Haters ;* apa Kabs ? Lanjut Blogwalking Om, Mulai hari ini gua bakal lebih banyak mengulas Jari...