Concept:Cost of goods sold is the total direct cost of inventory sold by a business during a period.Explanation:The formula used is:Cost of goods sold=Opening stock+Purchases−Closing stockOpening stock =D5,000Purchases =D30,000Closing stock =D7,000Sales of D55,000 are not used in this calculation.Substitute the given values into the formula:Cost of goods sold=D5,000+D30,000−D7,000First, add opening stock and purchases:D5,000+D30,000=D35,000Then, subtract closing stock from that total:D35,000−D7,000=D28,000Answer:The cost of goods sold is D28,000, which is option D.