The kinetic energy of an object is given by:
[tex] K=\frac{1}{2}mv^2 [/tex]
where m is the mass of the object and v its speed. The ball in this problem has a mass of m=0.2 kg and a kinetic energy of K=40 J, so we can rearrange the previous equation to find its speed:
[tex] v=\sqrt{\frac{2K}{m}} =\sqrt{\frac{2 \cdot 40 J}{0.2 kg}}=20 m/s [/tex]