(A) Frequency of the whistle,$\nu = 400\; Hz$.
Speed of the source (train),$v_s = 10\; m s^{-1}$.
Speed of sound,$v = 340\; m s^{-1}$.
The apparent frequency $(\nu')$ of the whistle as the train approaches the platform is given by the Doppler effect formula:
$\nu' = \left( \frac{v}{v - v_s} \right) \nu = \left( \frac{340}{340 - 10} \right) \times 400 = \frac{340}{330} \times 400 \approx 412.12\; Hz$.
The apparent frequency $(\nu'')$ of the whistle as the train recedes from the platform is given by:
$\nu'' = \left( \frac{v}{v + v_s} \right) \nu = \left( \frac{340}{340 + 10} \right) \times 400 = \frac{340}{350} \times 400 \approx 388.57\; Hz$.
$(ii)$ The apparent change in the frequency of sound is caused by the relative motion between the source and the observer. This motion does not affect the speed of sound in the medium. Therefore,the speed of sound in air in both cases remains $340\; m s^{-1}$.