Friday, January 25, 2019

√ Referensi Project Pemrograman C++ Dengan 2 Sub

ini contoh kiprah matakuliah stuktur data semester 2 saat saya kuliah di BSI Karawang. ini murni hasil kelompok kami. mungkin dapat dijadikan pola untuk kiprah kamu. bukan copas yaa,,
keep confident !


#include
#include
#include
#include
//fungsi judul
judul()
{
cout<<"            Nama-nama Kelompok"<cout<<"======================================"<cout<<"     NAMA                |     NIM   ="<cout<<"======================================"<cout<<"1. Andriyanto            |  12125653 ="<cout<<"2. Agustian Trimuharid   |  12125103 ="<cout<<"3. Hely Yuliyanto        |  12124528 ="<cout<<"4.        |  12124359 ="<cout<<"5. Heri Setiyabudi       |  12125654 ="<cout<<"6. Ivan Paryanto         |  12124371 ="<cout<<"======================================"<cout<<"                    TOKO ROTI"<cout<<"                  HOLLAND BAKERY"<cout<<"====================================================="<cout<}

//fungsi garis
garis()
{
cout<<"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"<}

main()
{
//deklarasi variabel
char tanggal[20];
char pembeli[25];
char kasir[25];
int bd,no;

struct
{
char size;
int kode;
int jumbel;
char *nama;
long harga;
}roti[10];

long subtotal,total=0,kembali,bayar;
char lagi;
awal://label untuk input lagi

//cetak tampilan input
clrscr();
judul();
cout<<"Tanggal Transaksi :";gets(tanggal);
cout<<"Pembeli           :";gets(pembeli);
cout<<"Kasir             :";gets(kasir);
cout<<"Banyak Data       :";cin>>bd;
garis();

cout<<"      *=MENU=*"<cout<<"1. Cocolate Bread    |"<cout<<"2. Mangoos Bread     |"<cout<<"3. Orange Bread      |"<cout<<"SIZE"<cout<<"A. Small  (Rp.5000)  |"<cout<<"B. Medium (Rp.7000)  |"<cout<<"C. Big    (Rp.10000) |"<//perulangan input
for(no=1;no<=bd;no++)
{
  cout<<"Data Ke-"<  cout<<"Kode Roti [1/2/3] :";cin>>roti[no].kode;
  cout<<"size      [A/B/C]:" ;cin>>roti[no].size;
  cout<<"Jumlah Beli :";cin>>roti[no].jumbel;
  cout<  }

//cetak tampilan output
clrscr();
judul();
cout<cout<<"Tanggal Transaksi :"<cout<<"Pembeli           :"<cout<<"Kasir             :"<garis();
cout<<"No  Nama  Roti      Harga     Jumlah Beli    subtotal"<garis();
//perulangan output
for(no=1;no<=bd;no++)
{
//proses if
if(roti[no].kode==1&&roti[no].size=='A')
{ roti[no].nama="Cocolate bread";
  roti[no].harga=5000;
   }
else if(roti[no].kode==1&&roti[no].size=='B')
{ roti[no].nama="Cocolate bread";
  roti[no].harga=7000;
  }
else if(roti[no].kode==1&&roti[no].size=='C')
{ roti[no].nama="Cocolate bread";
  roti[no].harga=10000;
  }


else if(roti[no].kode==2&&roti[no].size=='A')
{ roti[no].nama="Mangoos bread";
  roti[no].harga=5000;
   }
else if(roti[no].kode==2&&roti[no].size=='B')
{ roti[no].nama="Mangoos bread";
  roti[no].harga=7000;
  }
else if(roti[no].kode==2&&roti[no].size=='C')
{ roti[no].nama="Mangoos bread";
  roti[no].harga=10000;
  }


else if(roti[no].kode==3&&roti[no].size=='A')
{ roti[no].nama="Orange bread";
  roti[no].harga=5000;
   }
else if(roti[no].kode==3&&roti[no].size=='B')
{ roti[no].nama="Orange bread";
  roti[no].harga=7000;
  }
else if(roti[no].kode==3&&roti[no].size=='C')
{ roti[no].nama="Orange bread";
  roti[no].harga=10000;
  }

else
{ roti[no].nama="Kode Salah";
  roti[no].harga=0;
  }

//cetak data
cout<cout<cout<//rata kanan
cout<<"Rp."<cout<//hitung subtotal
subtotal=roti[no].harga*roti[no].jumbel;
cout<<"Rp."<//hitung total
total=total+subtotal;
}
garis();

cout<<"                                  Total Bayar:Rp."<cout<<"                                  Uang Bayar :Rp.";cin>>bayar;
kembali=bayar-total;
cout<<"                                 Uang Kembali:Rp."<cout<
cout<<"                 *=Terima kasih=* "<cout<<"       kepuasan anda ialah kebahagiaan kami"<cout<<""<cout<<"input Lagi ?[Y/T]:";cin>>lagi;
if(lagi=='Y'||lagi=='y')goto awal;

getch();
}

Sumber http://www.hendrisetiawan.com