In a single writing, Painter contracted with Farmer to paint three identical barns on her rural estate for $2,000 each. The contract provided for Farmer's payment of $6,000 upon Painter's completion of the work on all three barns. Painter did not ask for any payment when the first barn was completely painted, but she demanded $4,000 after painting the second barn. Assume that Farmer rightfully refused Painter's demand for payment. If Painter immediately terminates the contract without painting the third barn, what is Painter entitled to recover from Farmer? 
Nothing, because payment was expressly conditioned on completion of all three barns.  Painter's expenditures plus anticipated "profit" in painting the first two barns, up to a maximum recovery of $4,000.  The reasonable value of Painter's services in painting the two barns, less Farmer's damages, if any, for Painter's failure to paint the third barn.  The amount that the combined value of the two painted barns has been increased by Painter's work.