By using law of conservation of momentum, m1 u1 + m2 u2 = (m1 + m2)v, we have
v = {m1 u1 + m2 u2}/{m1 + m2}
= {0.012 x 70 + 0.4 x 0}/{0.12 + 0.4} = 2.04 ms-1
When bullet and block rise to the height h, using the law of conservation of total energy.
1/2 (m1 + m2)v2 = (m1 + m2) gh
i.e., h = v2/2g = (2.04)2/{2 x 9.8}
= 0.212 m = 21.2 cm
Also, heat produced = Loss in K.E.
= 1/2 m1u12 - 1/2(m1 + m2)v2
= 1/2(0.012)(70)2 - 1/2 (0.012 + 0.4) x (2.04)2
= 29.4 - 0.86 = 28.54 J