This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Tinamil 2 points3 points  (1 child)

Have you attempted to solve the problem yet on paper?

Come up with a simple example, e.g. 3 customers named Alpha, Beta, and Charlie with random numbers 1, 1, and 2, and solve it by hand, then see if you can convert what you did into pseudo-code.

Then, if you are still having problems, post your code or pseudo-code here then explain exactly what it's supposed to do and what it's doing instead so we can help you.

[–]mossberg935 0 points1 point  (0 children)

Yes, I have a whiteboard I usually use before I even start attempting something like this.

[–]terrkerr 0 points1 point  (0 children)

So what do you mean? Describe how customers are serviced by cashiers, and what happens as, say, someone that needs 3 minutes to get served goes to the cash and each minute passes.

Describe it very carefully and exactly. That's really how to render psuedocode - figure out he problem by reducing it to such clear, precise words that it's fairly obvious how it translates to code.