Question: > 
> A ball of mass $m$ is attached to a spring that is attached to a heavy moving cart (mass of cart $M >>$ mass of ball $m$) moving at velocity $V0$. The compressed spring with known spring constant $k$ is released and the ball is fired forward. The ball then strikes a similar spring with the same spring constant attached to a wall (i.e. the spring is attached to a heavy immovable object). How far does the spring attached to the wall compress?
> 
> 
> 

Is it just a matter of conservation of energy?
Ek(moving ball) + E(spring potential-for the moving spring) = E(spring potential-fixed spring)

Or does the motion of the initial spring somehow affect how much energy it can transmit to the ball. 

Or, in the frame of reference of the moving spring, can you simply calculate the velocity of the ball from E(spring potential) = Ek and add that to the initial velocity of the spring/ball and then use that new velocity to calculate the Ek and hence the energy transferred to the fixed spring and hence the compression of the spring. 

Depending on how you approach this problem you get different answers.

Answer: 
Of course, I assume no drag forces or frictional forces are involved here. Initially, while the cart in moving at a velocity $v$, the ball possesses energy of $\frac{1}{2}mv^2$.

Along with the elastic potential of the energy of $\frac{1}{2}kx\_1^2$, the sum of this energy will be converted to the kinetic energy of the moving ball, which is then converted to elastic potential energy of the second spring.

The equation should be as follows: $\frac{1}{2}mv^2+\frac{1}{2}kx\_1^2=\frac{1}{2}kx\_2^2$

However, it is flawed to calculate the amount of velocity the spring would impart to the ball and then summing it up with the cart's velocity (also the ball's velocity). This method can only work if the ball is initially stationary, meaning, the ball is stationary too. Energy is proportional to $v^2$, to increase each an object by $1ms^{-1}$, it requires more energy each time. Thus, we cannot do it that way.
If you want to use conservation of Mechanical Energy, use instead work energy theorem because conservation principles are frame dependent, but work energy theorem is frame independent.