A copy machine was purchased for $35,000 and had accumulated depreciation of $24,000. The machine was traded in for a new one that had a sticker price of $50,000. The vendor agreed to give a trade-in allowance for the old equipment in the amount of $9,000. How much will the company need to pay in cash, and what is the amount of the gain or loss?