Determining Ending Inventory and Cost of Goods Sold