The amount of heat given by the water to the block of ice can be calculated by using
[tex]Q=m_w C_{sw} \Delta T_w[/tex]
where
[tex]m_w = 30 g[/tex] is the mass of the water
[tex]C_{sw}=4.18 J/(g ^{\circ}C)[/tex] is the specific heat capacity of water
[tex]\Delta T_w = 45.0^{\circ}-19.5^{\circ}C = 20.5^{\circ}C[/tex] is the variation of temperature of the water.
Using these numbers, we find
[tex]Q=(30 g)(4.18 J/(g^{\circ}C))(20.5^{\circ}C)=2571 J[/tex]
This is the amount of heat released by the water, but this is exactly equal to the amount of heat absorbed by the ice, used to melt it into water according to the formula:
[tex]Q = m_i L_f[/tex]
where [tex]m_i[/tex] is the mass of the ice while [tex]L_f =334 J/g[/tex] is the specific latent heat of fusion of the ice.
Re-arranging this formula and using the heat Q that we found previously, we can calculate the mass of the ice:
[tex]m_i = \frac{Q}{L_f}= \frac{2571 J}{334 J/g} =7.7 g [/tex]