99 767
Assignments Done
98.5%
Successfully Done
In May 2021

Question #13235
P-1. (Salesperson Salary Ranges) Use a one-dimensional array to solve the following problem. A company pays its sales people on a commission basis. The sales people each receive 9 percent of their gross sales for that week so their salaries are variable. Write a program (using an array of counters) that determines how many of the sales people earned salaries in each of the following ranges (assume the user enters different salaries).
Example:
a) $200&ndash;299 2 employees b)$300&ndash;399 10 employees
c) $400&ndash;499 3 employees d)$500&ndash;599 4 employees
e) $600&ndash;699 5 employees f)$700&ndash;799 7 employees
g) $800&ndash;899 3 employees h)$900&ndash;999 0 employees
i) \$1000 and over 1 employee
1
2012-08-21T10:05:06-0400
#include <iostream.h>

int arr[10] = { 0, 2, 10, 3, 4, 5, 7, 3, 0, 1 }, i;
double sal;

void main(){
cout<<"enter the salary value please: ";
cin>>sal;
for(i=1;i<=9;i++){
if ((i*100<=sal)&&(sal<(i+1)*100)) cout<<arr[i-1]<<" employees\n";
}
if (sal>=1000) cout<<arr[9]<<" employees\n";
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!