#include
#include
#include
#include
char *nm (char kd)
{
if (kd=='a'||kd=='A')
return ("mouse");
else
return ("monitor");
}
int hrg (char kd)
{
if (kd=='a'||kd=='A')
return (50000);
else
return (500000);
}
int ttl (int hrg, int jml)
{
return (jml*hrg);
}
main()
{
int i,n,ttlbyr;
struct
{
char kd,nm[10];
int hrg, jml;
}mhs[5];
cout<<"banyaknya jumlah data :";cin>>n;
for(i=1;i<=n;i++) { cout<<"masukan data ke-:"<<
cout<<"masukan jml :";cin>>mhs[i].jml;
cout<
}
cout<<"PERHITUNGAN DATA BARANG"<
cout<<"-----------------------------------------"<
cout<<"no kdbrg nmbrg hrg jmlbeli total"<
cout<<"-----------------------------------------"<
for(i=1;i<=n;i++)
{
cout<
cout<
cout<
cout<
cout<
cout<
ttlbyr=ttlbyr+ttl(mhs[i].kd, mhs[i].jml);
cout<
}
cout<<"-----------------------------------------"<
cout<<" TOTAL BAYAR ="<
getch();
}
0 komentar:
Posting Komentar
Silahkan beri komentar dengan bijak dan jangan sampai komentar anda masuk dalam {COMMENTS SPAM}. Thanks