You know the mean cost is calculated from ...
... (mean cost) = (total cost)/(number of items)
You are given the mean cost and the number of items, so you can find the total cost for the 8 items as ...
... (mean cost)×(number of items) = (total cost)
... 8 × $3.05 = (total cost) = $24.40
You are given the costs of 7 of the items so ...
... (total cost) = (8th item cost) + (total cost of 7 items)
Then we can find the (8th item cost) as ...
... (8th item cost) = (total cost) - (total cost of 7 items)
Adding up the given cost of the 7 items, we get ...
... (total cost of 7 items) = $20.57
... (8th item cost) = $24.40 -20.57 = $3.83
The price of the 8th item in the bag was $3.83.