I have an exercise from a textbook that gives different answers from what I've found myself.
What the exercise says:
$8$ girls and $4$ boys are at a party. In how many ways can they form a (non-circular) dance queue so that:
a) all of the boys are in consecutive places ?
b) The first and the last position of the queue are taken by girls and none of the boys are next to another boy ?
What I've done:
a) The queue has a size of $12$. The $4$ boys can be placed consecutively in $12-4+1 = 9$ ways considering that each boy was the same. But since each human is unique there are $9 * 4!$ ways. The girls can fill the rest of the queue in $8!$ ways so the final result is supposed to be $8! * 9 * 4!$.
The book gives only $9*4!$ as the answer.
b) Let us attach a $G$ after each $B$. We can do that in $8*7*6*5$ ways. Then, these $8$ girls can be ordered in $8!$ ways. So the result should have been $8! * 8*7*6*5$.
The book gives $8! * 7 *6 *5 *4$ as an answer.
Your first answer is correct.
For the second problem, the book is correct. You ignore that the first girl cannot be one of the ones who is after a boy. Another way of looking at it is that girls can be arranged in $8!$ ways. Then the first boy can be placed in one of the $7$ gaps between the girls, the second boy in one of the remaining $6$ gaps, and so on.