## FAQ for Barber Shop Projects

• I made two assumptions in my program: one is that there is only one fat general in the military reservation.

Yes, only one general

• Another assumption is that when grunts in the grunt queue got their haircut, the other grunts in the grunt queue increase their waits number which measures whether they should be promoted or not.

Yes, that is how it works. This of course has its own problems, but seems to make the current implementation easier.

• In the sample output for Basic Barber Shop Project, there is an NCO in the barber's chair, 7 waiting, and 3 who have gotten their hair cut. This yields a total of 11 NCOs, but the output says that only ten have entered. Is this a bug in the output, does the person in the chair count as having their hair cut the instant they enter the chair, or does the person in the chair count as still waiting?

Interesting question. As i have mentioned, the output was generated by hand in the interest of trying to get uniformity. I looked at my actual code and I count the person in the chair as neither waiting nor complete. This of course puts the counts off for one person type at almost all the printouts. Thinking about it, I think there are arguments for various ways; (counting them done as soon as they leave the chair set, not counting them until they are actually done, etc.)
So my answer at this time is to count the person in the chair however you want, but explain how you counted them in your write up.

• Are we were allowed to add new queues for the grunts that move up, i.e. have two more queues, one which has priority over everything else, and the other which has priority only over grunts.

No. the key problem is managing priorities within existing queues. your approach would get around that...

• I have a question about the general - you said he takes up two adjacent chairs - do chairs 19 and 0 count as being adjecent - it would seem so to me since the waiting area is supposed to be circular, but i thought i'd make sure.

Your question is interesting in that logically the buffer is circular, but physically it is not. i would argue that the general CANNOT sit in 19/0. this is based purely on my physical view of the world. if you really want to do it otherwise, then do so, but present the argument in your writeup....

• Is "the Barber shop" the whole project? Are we not allowed to use pointers at all??? What specifically are we not supposed to use pointers for?

The project desciption says "Assume that you DO NOT have a pointer datatype for the Barber Shop." Specifically, you are not supposed to use pointers for any of the linked lists needed to implement the queues.Instead, you must use array indices. The queues should be linked lists implemented inside an array, with the "next" pointers being array indices.

• Is there a fixed-width argument or something for cout? or how do I do this? or how do I figure out how to do this?

Yes. There are two ways, both done stupidly because the effect is "sticky". The easiest way is with setw:

```
#include
#include

cout << setw(2) << x << setw(0) << endl;
```
You have to do setw(0) or you'll wind up with everything else you put out taking a minimum of two columns.That's why it's stupid.