#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
void main(){
int a=1,data,i;
char nama_sales[100];
double totpen, bonus;
cout<<"masukan banyak sales : " ;cin>>data;
for(i=1;i<=data;i++)
{cout<<endl;
cout<<"nama sales : " ;cin>>nama_sales[i];
cout<<"total penjualan : " ;cin>>totpen;
cout<<endl;
}
cout<<endl;
cout<<"_______________________________________"<<endl;
cout<<"No Nama sales total penjualan"<<endl;
cout<<"_______________________________________"<<endl;
for (i=0;i<=data;i++) {
cout<<" "<<a++<<setw(8)<<nama_sales[i]<<setw(19)<<totpen<<endl;
} cout<<"_______________________________________"<<endl;
cout<<endl;
if (totpen>=5.000000){
cout<<"bonus = 500.000";
}
else if ((totpen=4.000000)&&(totpen<5.000000)){
cout<<"bonus = 500.000";
}
else if ((totpen=3.000000)&&(totpen<4.000000)){
cout<<"bonus = 400.000";
}
else if ((totpen=2.000000)&&(totpen<3.000000)){
cout<<"bonus = 300.000";
}
else if ((totpen=1.000000)&&(totpen<2.000000)){
cout<<"bonus = 200.000";
}
cout<<endl;
cout<<"_______________________________________"<<endl;
cout<<"No Nama sales bonus "<<endl;
cout<<"_______________________________________"<<endl;
for (i=1;i<=data;i++) {
cout<<" "<<a++<<setw(8)<<nama_sales[i]<<setw(19)<<bonus<<endl;
} cout<<"_______________________________________"<<endl;
getch();
}
Posting Komentar