Originally Posted by

**schip666**
Sounds like you are at the absolute-beginner level, which is great because there's all kinds of interesting things to learn. At that level I'd think what they want is a conceptual solution to the problem. An algorithm is just a recipe for how to do something. I would just try to think through the problem and figure out how I would do each step remembering that a computer is very stupid and needs to be told how to do just about everything.

For instance, we know from the problem setup that we will get a bunch of strings of alpha-numeric digits as input and need to sort them into bins for each department so we can count them. Since the department is coded in the first character of the string, the algorithm might be:

1. Get input string;

2. Look at first character;

3. Put into bin for that character.

Then every day:

1. At end of day;

2. Count items in each bin;

3. Calculate percentages:

a. sum the total number of items in all bins;

b. for each bin:

i. divide number in bin by total sum;

ii. print it out someplace.

The hard part is coming up with something that validates the codes. You could have a few types of errors:

1) a non-existent "department code";

2) an non-existent "item number";

3) various mixed up department codes and item numbers;

4) probably even more arcane errors...

So it just keeps on getting more complicated as you go.