Back to Topic List
Hi Kevin,
how should I calculate the expected average of final temperatures? Because I've got the same final temperatures for the first example (102.758 and 117.242), avg of them is exactly 110. I don't understand the value 110.998500 as the expected answer.
(Running my code with the larger example, I've got error less than 1. For the real input my error is much less (but large enough not to be accepted)).
Hi Adam,
It looks like you're handling the averaging correctly - I don't see any issues there.
Rather, I think there may be an error on the line double T = Q / (c * m);.
This is a correct equation for any individual material, but different materials may have different values of c or m.
And so two adjacent cubes of differing material will exchange some equal amount of Q,
but then we would expect them to change by different amounts of T.
I apologize again for the delayed response!
Hi Kevin,
thanks for finding my error, I should have been more careful. My answer has been accepted now.