#include
#include
#include
void main()
{
char nama[50][20];
int permen,bayar,pembeli,a,tot_per_terjual=0,totpengasilan=0;
float total,kembali;
cout<<"masukan banyak pembeli permen : ";cin>>pembeli;
for(a=1;a<=pembeli;a++)
{
cout<<"---------------------------------\n";
cout<<"masukan nama pembeli : ";cin>>nama[a];
cout<<"masukan banyak permen : ";cin>>permen;
cout<<"masukan uang bayar : ";cin>>bayar;
total=permen*100;
kembali=bayar-total;
cout<<"total bayar : ";cout<<
cout<<"uang kembali : ";cout<<
cout<<"---------------------------------\n";
cout<
tot_per_terjual=tot_per_terjual+permen;
totpengasilan=totpengasilan+total;
}
cout<<"---------------------------------------------------\n";
cout<<"| total permen terjual | total penghasilan |\n";
cout<<"---------------------------------------------------\n";
cout<< <<"|"
<< <
<< <<"|"
<< <<" "
<< <
<< <<"|"<
cout<<"---------------------------------------------------\n";
getch();
}
Home »Unlabelled » Contoh program C++ dalam penggunaan ( for )
Contoh program C++ dalam penggunaan ( for )
Posted by
Adhit
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment