Calculating the cost of an item