Program daftar pemesana barang menggunakan STRUCTUR(bahasa C)


#include
#include
#include
#include
const nmak=10;

struct barang
{ char kd_brg[10];
char nm_brg[20];
int qty;
long int harga;
long int total;
};

struct data
{ int no;
char kd_sp[10];
char nm_sup[20];
barang brg[5];
};

main()
{
clrscr();
data dt[nmak];
int a,b,c,x;
long int total;

cout<<"masukkan jumlah supplier : ";
cin>>x;
for(a=1;a<=x;a++) { cout<<"\nno : ";
cin>>dt[a].no;
cout<<"kode supplier : ";
cin>>dt[a].kd_sp;
cout<<"nama supplier : ";
gets(dt[a].nm_sup);
cout<<"\nmasukkan jumlah barang yang diinginkan : "; cin>>c;
for(b=0;b<<"\n\nBARANG KE-"<<(b+1);
cout<<"\nkode barang : ";
gets(dt[a].brg[b].kd_brg); cout<<"nama barang : ";
gets(dt[a].brg[b].nm_brg); cout<<"quantity : ";cin>>dt[a].brg[b].qty;
cout<<"harga : ";cin>>dt[a].brg[b].harga;
total=dt[a].brg[b].qty*dt[a].brg[b].harga;
cout<<"total =";
cout<
cout<<"\n"; } } clrscr(); cout<<" DAFTAR PEMESANAN BARANG\n";
cout<<" PT.KASIH FARHAN\n"; cout<<"================================================================================\n"; cout<<"No"; cout<<<"Kd_Sp";
cout<<<"Nama Supplier"; cout<<<"Kd_Brg"; cout<<<"Nama Barang";
cout<<<"Qty"; cout<<<"harga";
cout<<<"Total"; cout<<"\n===============================================================================\n"; for(a=1;a<=x;a++) { cout<<<
cout<<<
for(b=0;b
{
if(b==0)
{
cout<<<
cout<<<
cout<<<
cout<<<
}
else
{
cout<<<<
cout<<<
cout<<<
cout<<<

}
}
cout<<"\n______________________________________________________________________________\n"; } getche(); }

Share this article :

0 comments:

Speak up your mind

Tell us what you're thinking... !

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. My Kampuzzzz - All Rights Reserved
Template Created by Creating Website Inspired by Sportapolis Shape5.com
Proudly powered by Blogger