Final answer:
The company experienced a $3,000 loss on the sale of the machinery, calculated by subtracting the sale price from the machine's book value derived from its original cost and accumulated depreciation.
Step-by-step explanation:
To determine the gain or loss on the sale of the machinery, we must first calculate the book value of the machine at the time of sale. The original cost of the machine was $38,000, and it had accumulated depreciation of $20,000. Therefore, the book value of the machine is the original cost minus the accumulated depreciation, which is $18,000 ($38,000 - $20,000).
Next, we compare the book value of the machine with the sale price. The machine was sold for $15,000 in cash. Since the book value of the machine is higher than the sale price, we have a loss. The loss is calculated as the book value minus the sale price, which is $3,000 ($18,000 - $15,000).
Thus, the final answer is a $3,000 loss.