if a grocery store buys 30 gallons of milk at a cost of $1.58 per gallon, he anticipates a 15% spoilage rate , to achieve a 20% markup based on selling price what should it be

I say $ 2.19 per gallon

The cost of the milk to the store is

30 x $1.58 = $47.40

To recover the cost of the milk if 15% lost then the cost per gallon is

$47.40/25.5 = $1.86 per gallon

$1.86/0.80 = $2.35 per gallon

which is %20 markup based on selling price.
20% markup of cost will give a different result.

...check my maths though!