The cost of a bag of apples is based on the cost of the type of apple and the total number of apples in the bag.