I'm confused because it says selling price twice but seems to be referring to two different things. When I try to work the problem the way I learned it the problem won't solve. This is how I've been trying to solve this. Below I solved only for the purchase price.
Selling price=S, Purchase price=P, Markup=M. Also, M equals P times whatever percentage the problem dictates.