When a company exchanges machinery and receives a trade-in allowance greater than the book value, this transaction would be recorded with the following entry (assuming the exchange was considered to have commercial substance)?

a. debit Cash and Machinery; credit Accumulated Depreciation and Machinery
b. debit Machinery and Accumulated Depreciation; credit Machinery, Cash, and Gain on Disposal
c. debit Cash and Machinery; credit Accumulated Depreciation
d. debit Machinery and Accumulated Depreciation; credit Machinery and Cash