(a) Since the ambulance and the car are moving one relative to each other, we have to use the general formula of the Doppler effect, which gives us the shift of the frequency of the siren as heard by an observer in the car:

where
f' is the apparent frequency as heard by the observer in the car
v is the velocity of the wave

is the velocity of the observer (positive if it is moving towards the source, negative if it is moving away)

is the velocity of the source (positive if the source is moving away from the observer, negative if is is moving towards it)
f is the real frequency of the sound
In the first part of the problem:

(speed of the sound wave)

(the car is moving away from the ambulance)

(the ambulance is moving towards the car)

(original frequency of the sound)
If we plug the numbers into the formula, we find

b) This time, the ambulance passes the car, so the ambulance is now moving away from the car; this means that

must be positive:

Moreover, the car is now moving towards the ambulance, so we should reverse also the sign of

:

All the other data do not change, so if we use the same formula as before, we find