assuming that the rocket keeps moving to the right at 3.0 m/s after launch you first calculate the time it takes for the rocket to travel 20m.
Acceleration is F = MA, 0.5 KG for mass, and Force is 8 N so A is 16-9.8 m/s^2.
So functions for movement are:
a(t) = 16-9.8=6.2
v(t) = 6.2t
p(t) = 3.1t^2
Solve for p(t) = 20
t = 2.5 seconds.
Next question is how far will the cart move to the right in 1.58 seconds?
Answer is 2.5*3 = 7.5 meters.
I realize this might be too late but I wanted to see if I could remember how to do this stuff because I have not seen such problems in years.