Here is what the problem is:

Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The sales person recieves $200 a week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9 percent of $5000 or a total of $650. Write a 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):

a)$200-299

b)$300-399

c)$400-499

d)$500-599

e)$600-699

f)$700-799

g)$800-899

h)$900-999

i)$1000 and over.

Here is the code I have so far but I dont know if im on the right track or not. I suck at c++. If anyone could look at it and tell me if im on the right track or not, I would greatly appreciate it, thanks.

#include <iostream>

using namespace std;

const int counterSize=10;

const int rangeSize=27;

int counter[counterSize]={0};

int ranges[rangeSize]={1,2,3,4,5,6,7,8,9,10,

2,5,7,9,4,5,7,9,3,7,1,4,

5,6,7,8,3};

for(int salary=0; salary<rangeSize; salary++)

++counter[ranges[salary]];

//outputting frequencies

cout<<"Range"<<"/t/t/t/t/t/t"<<"Frequency"<<endl;