Dear student,
By using the formula, to calculate the specific heat,
Q=ms∆T
where Q= heat energy
m= mass of substance
s= specific heat
T= temperature
Putting the values in the above equation
8000 J=200 x 0.4(Tf-Ti)
Where, Tf= final tempaerature
Ti= initial temperature
8000=200 x0.4 (Tf-20)