Codingan fungsi Struc pada C++

Assalamu’alaikum, berikut ini adalah codingan fungsi struck semoga bermanfaat untuk semua …

#include
#include
using namespace std;
struct padangmart
{
char kode[15];
char jb[20];
char nb[30];
float harga;
float hasil;
float diskon;
};
int main()
{
cout<<"============================================================="<<endl;
cout<<"======================WELCOME TO PADANGMART=================="<<endl;
cout<<"============================================================="<<endl;
cout<<endl;
padangmart pmrt;

cout<<"Kode Barang : ";
cin.getline(pmrt.kode,15);
cout<<"Jenis Barang : ";
cin.getline(pmrt.jb,20);
cout<<"Nama Barang : ";
cin.getline(pmrt.nb,30);
cout<>pmrt.harga;
cout<>pmrt.diskon;
{
pmrt.hasil = pmrt.harga*pmrt.diskon/100;
pmrt.hasil = pmrt.harga-pmrt.hasil;
}

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

cout<<"Kode Barang yang anda pilih : "<<pmrt.kode<<endl;
cout<<"Jenis Barang yang anda pilih: "<<pmrt.jb<<endl;
cout<<"Nama Barang yang anda pilih: "<<pmrt.nb<<endl;
cout<<"Harga Barang yang anda pilih: "<<pmrt.hasil<<endl;
cout<<endl;
cout<<"============================================================="<<endl;
cout<<"Selamat Anda Mendapatkan Diskon "<<pmrt.diskon<<"%"<<endl;
cout<<"============================================================="<<endl;
system("PAUSE");
return 0;
}

About chandechildz

I'm the simple man Always happy everday every time every well View all posts by chandechildz

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: