//Kyu Bae //Assignment 4B //Purpose; // The program provides the opportunity to : // 1) Use an if statement. // 2) Process a simple string. // 3) Reinforce objectives of previous lab projects. #include #include #include int SalesNumber (void);//salesperson's identification number double SaleDollar(void);//amount salesperson sold float BaseRate (void);//basic commission rate char CheckCode(int iPersonId);//ckecking the code which indicate where employee works void DoMath ( char cCode[], double dAmount, float fRate, int iPersonId); //domath check the code and calculate the basic commission and bonus int main(void) //main function { int iPersonId ; //variable for person identification double dAmount; float fRate; char cCode[3]; iPersonId=SalesNumber(); //personid returned from salesnumber function dAmount=SaleDollar(); //dAmount value returned from saleDollar function. fRate=BaseRate(); //fRate value returned here from BaseRate func. cout <<"enter your region code('er' or 'wr'):"<> iPersonId; return iPersonId; } double SaleDollar (void) //entering employee sales amount. //passing the amount to main func. { //no output double dAmount; cout <<"enter your sales amount(xxxxx.xx):" << endl; cin >> dAmount; return dAmount; } float BaseRate (void) //entering base commission rate { //passing the rate to main func. //no output. float fRate; cout <<"enter your basic commission rate(.XX): "<< endl; cin >> fRate; return fRate; } void DoMath ( char cCode[], double dAmount,float fRate, int iPersonId) { //checking region code and calculating the base commission and bonus //passing none //print sales id, rate, code, base commission, and bonus //if wrong code is entered. print the error message and employee id. double dBaseCom; if(strcmp(cCode, "er")==0) if(dAmount>1000) { dBaseCom=((dAmount*fRate)+((dAmount-1000)*(0.01)));// base commission and bonus pay calculation cout<<"your salesperson #: "<2000) { dBaseCom=((dAmount*fRate)+((dAmount-2000)*(0.02))); cout<<"your salesperson #: "<