One might attempt the problem in terms of total heat content, but 'average temperature' does not pass muster.
If you know the air temperature and the specific heat of the air then you get the internal energy of the air.
For the water it works the same way.