I've been trying to figure out part (b) of this question but I just can't! So I was hoping someone here could help me. It goes like this:
A 5.0g marble is fired vertically upward using a spring gun. The spring must be compressed 8.0cm if the marble is to just reach a target 20m above the marble's position on the compressed spring. (a) What is the change ΔUg in the gravitational potential energy of the marbleEarth system during the 20m ascent? (b) What is the change ΔUs in the elastic potential energy of the spring during its launch of the marble? (c) What is the spring constant of the spring?

For part (a) I got 0.98J which the book says is correct, but the book got 0.98J for part (b)... HOW?! May textbook doesn't give any example questions of gravitational and elastic potential energy in the same system, so I have no idea what to do. Would really appreciate some help!