Gross profit = selling price - purchase price
A 40% gross profit means that selling price is 40% more than purchase price
(selling price - purchase price)/selling price *100 = 40
(selling price - 15) / selling price * 100 = 40
If selling price = x then
(x-15) *100/x = 40
(x-15) * 100 = 40x
x-15 = 0.4x
x = 21
Selling price for a 40% gross profit is $ 21