We are given 5 boys and 4 girls. We need to find two things:
1. Number of ways all boys sit together:
If all the boys sit together, treat them as a single unit. This gives us 5 boys as one block. Now, the number of units to arrange is 5 units (1 block of boys and 4 girls).
The number of ways to arrange these 5 units is \( 5! \).
The boys can be arranged within their block in \( 5! \) ways.
Thus, the total number of arrangements for all boys sitting together is:
\[
\text{Ways for all boys together} = 5! \times 5! = 120 \times 120 = 14400.
\]
2. Number of ways no boys sit together:
If no boys sit together, we first arrange the 4 girls. The number of ways to arrange the girls is \( 4! \).
Now, the 5 boys need to be placed in the 5 available positions between the girls (one before the first girl, one between each pair of girls, and one after the last girl).
The number of ways to place the boys in these positions is \( 5! \).
Thus, the total number of arrangements for no boys sitting together is:
\[
\text{Ways for no boys together} = 4! \times 5! = 24 \times 120 = 2880.
\]
Now, sum the two results:
\[
\text{Total number of ways} = 14400 + 2880 = 17280.
\]
Thus, the total number of ways is \( \boxed{17280} \).