@JTT,
The key is that the heat lost by the warmer water is equal to the heat gained by the cooler water. Taking some quick shortcuts (i.e. realizing that gallons are proportional to mass in this case and that specific heat capacity cancels out)...
The heat lost by the warmer water (which is mass * C * change_in temperature) is
50 gallons * C * (140 - T)
(The shortcut is OK because C is in Joules/(Gallon degree Fahrenheit).
The heat gained by the cooler water is
300 gallons * C * (T - 90)
So 50 * C (140-T) = 300 * C * (T - 90)
So the C's cancel out (thank goodness)... and the equation is
7000 - 50T = 300T - 27000
350T = 34000
T = 97.14 F