i need help in this question (write an c++ code that reads ID numbers of a sequence of salesmen and the amount of sales they made and prints out the ID number ,sales and the commission that each salesmen will get and to print also the highest sale and the number of salesmen making this highest sale.
Instead of waiting for someone to do your homework for you, you should probably try to learn the language, then attempt it. Once you have given a valiant attempt, then we'll help guide you in the right direction. Any errors you run across, we'll gladly take a look at them.
#include <iostream.h>
void main ()
{
#include <iostream.h>
void main ()
{
int i,sales,id,com,n;
cout<<"how many salesmen do you have"<<endl;
cin>>n;
for (i=1;i<=n;i++){
cout<<"Enter ID"<<endl;
cin>>id;
cout<<"enter employe sales ; enter -1 to end"<<endl;
cin>>sales;
if (sales<50)
com=0;
elseif (sales>=50||sales<=100)
com = sales*0.05;
else {
com=sales*0.1;}
cout<<"ID =" <<id<<"\tSALES ="<<sales<<"\tCOMMISSION = "<<com<<endl;
}
}
but now i dont know how to do the last part ( print also the highest sale and the number of salesmen making this highest sale.)