The company pays a sales person on a commission basis. The sales person receives $200 per week plus 9 % of their gross salary for that week. For ex. if sales person who grosses 5000$ then he paid $650($200+$450). Write a prog in C++ (using array of counter) that determine how many of the sales person earned salaries in each of following ranges (assume that each sales person salary is truncated to an integer amount) :a. $200-$299 b. $300-$399 so on..i. $1000 and over

Showing Answers 1 - 3 of 3 Answers

google_ever

  • Oct 21st, 2008
 

int a[8]= {0,0,0,0,0,0,0,0};

int b[n]; // Here b is the array of employee's salaries.

for(int iLooper=0; iLooper<n; iLooper++)
 iIndex = ((int)b[iLooper]/100) > 10) ? 8:((int)b[iLooper]/100)-2;
a[iIndex]++;


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions