# help w/ array problem

• 11-11-2002
rhythm313
help w/ array problem
i'm having a problem with a homework question and i was hoping someone could give me a little help. Here it is:

6.10 Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople recieve \$200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses \$3000 in sales in a week recieves \$200 plus 9 percent of \$3000, or a total of \$470. Write a C program (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount):
1. \$200-\$299
2. \$300-\$399
3. \$400-\$499
4. \$500-\$599
5. \$600-\$699
6. \$700-\$799
7. \$800-\$899
8. \$900-\$999
9. \$1000 and over

(end of problem)

Now either this problem is so simple and i'm not reading it right or i just don't have a clue! Any help would be great!
• 11-11-2002
alpha
well, try rereading the problem...but: check through the salaries using if statements to check values and add to the counters...for example

array[0]++;

hope this helps...
• 11-11-2002
rhythm313
problem w/array question