Bintara melanjutkan yang part 3 , ok cekidot . .
1. Program 1
#include <iostream.h>
#include <conio.h>
int a;
int garis();
int main()
{
struct wkt
{
int tgl,bln,thn;
}
wkt = {29,11,2013};
struct isi
{char kdbrg[10],nm[20];
int hrg,potong;
};
struct
{struct isi barang;
int jumlah;
}
isi1={"3009","Mouse",75000,20,6};
struct
{struct isi barang;
int jumlah;
}
isi2={"5091","Screen Guard",20000,15,7};
struct
{struct isi barang;
int jumlah;
}
isi3={"1546","Keyboard",45000,40,5};
struct
{struct isi barang;
int jumlah;
}
isi4={"6701","Speaker Active",15000,75,8};
struct
{struct isi barang;
int jumlah;
}
isi5={"8001","Bakwan",1500,20,17};
cout<<"[___DAFTAR PRODUK___]\n";
cout<<"Tanggal Penjualan : "<<wkt.tgl<<"/"<<wkt.bln<<"/"<<wkt.thn<<"\n\n";
cout<<"Nama \t\t|| Harga \t|| Diskon(%) \t|| Jumlah\t"<<endl;
garis();cout<<endl;
cout<<isi1.barang.nm<<"\t\t|| "
<<isi1.barang.hrg<<"\t|| "
<<isi1.barang.potong<<"\t\t|| "
<<isi1.jumlah<<endl;
cout<<isi2.barang.nm<<"\t|| "
<<isi2.barang.hrg<<"\t|| "
<<isi2.barang.potong<<"\t\t|| "
<<isi2.jumlah<<endl;
cout<<isi3.barang.nm<<"\t|| "
<<isi3.barang.hrg<<"\t|| "
<<isi3.barang.potong<<"\t\t|| "
<<isi3.jumlah<<endl;
cout<<isi4.barang.nm<<"\t|| "
<<isi4.barang.hrg<<"\t|| "
<<isi4.barang.potong<<"\t\t|| "
<<isi4.jumlah<<endl;
cout<<isi5.barang.nm<<"\t\t|| "
<<isi5.barang.hrg<<"\t\t|| "
<<isi5.barang.potong<<"\t\t|| "
<<isi5.jumlah<<endl;
garis();
getch();
}
int garis()
{
for (a=1;a<=60;a++){
cout<<"=";}
}
Ok sekian dulu postingan kali ini , semoga bermanfaat ,, salam
BIntara . .
Related Post:
Title
:
Pemrograman Menggunakan C++ Struct Part 4
Description
:
Pemrograman Menggunakan C++ Struct Part 4 Bintara melanjutkan yang part 3 , ok cekidot . . 1. Program 1 Script Program #include ...