Potential Energy of the compressed string at x=3.0cm:
W = (1/2)*k*x^2
where k = spring constant = 15 N/m
x = distance = 3.0 cm
W = (1/2)*15*3^2
W = 67.5
Total work:
W_t = (1/2)*k*x^2
where x = 4+3 = 7
W_t= (1/2)*15*7^2
W_t = 367.5
W_t - W = 367.5 - 67.5
Work needed for the additional 4 cm is
300 J