Let y be the cost of the party and x the number of guests. Since we are told to assume that the relationship is directlly proportional, we have that

where k is a positive constant.
We are told that y is 40 whenever x is 5. So we have the equation

so, multiplying both sides by 5, we get

So we have the equation

Now, we are interested in finding y when x=6. So we have that

So the cost for a party of 6 is 48.