Assuming no heat loss to the surroundings, the amount of heat lost by one material should be equal to the amount of heat gained by the other material. In this case, iron piece had an initial temperature of 99.3 degrees Celsius and a final temperature of 30.8 degrees Celsius. Thus, iron piece lost heat and an equivalent amount of heat is (ideally) gained by water.
The amount of heat lost or gained can be calculated as the product of mass of material, its specific heat capacity and the change in temperature. The specific heat capacity of iron is 0.45 J/g/degree C and that of water is 4.186 J/g/degree C.
The amount of heat lost by iron = mass of iron piece x specific heat capacity of iron x change in temperature
= 0.115 kg x 1000 g/kg x 0.45 J/g/degree C x (99.3 - 30.8) degrees C
= 3544.875 J
The same amount of heat is gained by water. Assuming the initial temperature of water to be T degrees Celsius,
0.12 kg x 1000 g/kg x 4.186 J/g/degrees C x (30.8 - T) degrees C = 3544.875 J
Solving this equation, we get: T = 23.7 degrees C.
Thus, water had an initial temperature of 23.7 degrees C and gained 7.1 degrees C.