1. Create an array of ints of size 9 (for 9 salary brackets). Initialize it to zero.
2. Take user input to determine how many employees we have.
3. Create a 'for' loop, which runs once for each employee. In the loop ask for their gross sales. Calculate 9%, add that to 200, and increment the appropriate element of the counter array.
4. Loop through each bracket of salaries and display the value of the appropriate counter.
Note: When trying to determine what bracket a particular salary falls under, you could do it the simple way and add a bunch of 'if' statements. Even simpler though, would be to divide the salary by 100 (keeping everything as integers), and switching on the result. Look at how the brackets are set up:
If you earnt anything from $800 to $899, dividing that number by 100, and taking the result as an integer (no decimals), gives you 8. Thus we can use the following code:
i)$1000 and over.
As you can see, the Counters[n]++; statement will simply be repeated over and over. Also observe that the index used is always 2 less than the value of the 'case' statement. Thus we can shorten that code like so:
Counters++; //Increment the counter for that bracket
Counters++; //Increment the counter
The '(int)' is needed to remove the decimals resulting from the division.
I hope this has helped.