For each problem I assume that it is not fixed what rooms will be blue, red or green; just that some number of the total must be a particular color.
a) If 5 are to be painted a shade of blue and 2 a shade of green.
First choose which 5 of the 7 rooms will be blue. There are C(7,5) such choices. Each of the blue rooms can be 1 of 4 different shades. So there are 4 choices for the first room, 4 for the second, and so on. Thus there are 4^5 ways the 5 blue rooms could be painted. Likewise there are 3 ways for the one green room to be painted and 3 for the other green room. So there are C(7,5)(4^5)(3^2) total ways to paint the rooms with the above restrictions.
b) 3 rooms some shade of red, 3 rooms some shade of blue and one room some shade of green, how many different ways can the seven rooms be painted?
In a similar way as the previous problem you can see that there are C(7,3) choices of the 3 red rooms, C(4,3) choices left for the 3 blue rooms, and the last room (green) is forced by these first two choices. Then there are C(7,3)C(4,3)(2^3)(4^3)(3) ways to paint the 7 rooms with the above restrictions.
c) How many ways can the rooms be painted?
In this problem you can think of each room individually as having 9 different choices of color. (4 blue + 3 green + 2 red). So there are 9^7 ways to paint all 7 rooms without restriction.
d) all the rooms are painted red?
2 red shade choices for each room. So the total is 2^7.
e) at least one room is green or blue?
Ask it in a different way. How many ways are there to paint the rooms without any blue and without any green.