Thanks Nih Masih Ngunjungin Blog Ane ,hehehe.
Sekarang Ane mau Ngeshare Lagi Ni guys Tentang Program Sederhana Dengan Bahasa C++.
Monggo ,.,
PROGRAM STRUK TOKO MADU "C++"
--------------------------------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
//Pembuka
main()
//Body
{
//Tipe data
char np[20],kb,*lebah;
int bp,harga,subtotal;
//input
cout<<" Madu Lebah "<<endl;
cout<<" TOKO LEBAH "<<endl;
cout<<"========================----------------========================="<<endl;
cout<<" Nama Pembeli :";gets(np);
cout<<" Kode Belanja [H/R/K] :";cin>>(kb);
cout<<" Banyak Pembelian :";cin>>(bp);
//proses
if(kb=='H' || kb=='h')
{
lebah="Madu Lebah Hutan";
harga=2000;
}
else if(kb=='R' || kb=='r')
{
lebah="Madu Lebah Rindu";
harga=3000;
}
else if(kb=='K' || kb=='k')
{
lebah="Madu Lebah Kurma";
harga=5000;
}
subtotal=harga*bp;
//output
clrscr();
cout<<" BUKTI PENJUALAN MADU LEBAH "<<endl;
cout<<" Toko Lebah "<<endl;
cout<<" Jl.kamana Weh Lah No.19 Jonggol "<<endl;
cout<<" "<<endl;
cout<<"===================================="<<endl;
cout<<" "<<endl;
cout<<"Nama Pembeli :"<<np<<endl;
cout<<"Kode Belanja [H/R/K] :"<<kb<<endl;
cout<<"Nama Lebah :"<<lebah<<endl;
cout<<"Harga Madu :"<<harga<<endl;
cout<<"Banyak Pembelian :"<<bp<<endl;
cout<<"------------------------------------"<<endl;
cout<<" Total =Rp."<<subtotal<<endl;
//Penutup
getch();
}
========================================================================
Selamat Mencoba ,.
Semoga Bermanfaat ,.
0 Komentar