If 2.80 kJ of heat is needed to raise the temperature of a sample of metal from 10.°C to 27°C, how many kilojoules of heat will be required to raise the temperature of the same sample of metal from 40.°C to 58°C?

For the same amount of material, the amount of heat required is proportional to the temperature increase. That increase changes from 17 to 18 C

The answer is 2.80kJ * (18/17)
= 29.7 kJ