Use the following data to calculate the cost of merchandise sold:
Sales:$80,000
Beginning inventory:$5000 Purchases:$21,800
Purchase discounts:$790
Ending inventory:$5,100