After hitting, the system spring+mass has only kinetic energy in the first moment because the spring is still uncompressed.
`E_k =(m*v^2)/2 =(0.9*0.48^2)/2 =0.10368 J`
When `x =x_max=A` there is only the potential energy stored in the spring (the speed of mass is zero).
`E_p =(k*A^2)/2`
Supposing there is no friction the total energy of the system mass+spring need to be the same in all positions x of the mass. Thus
`(k*A^2)/2 =0.10368`
`A = sqrt(2*0.10368/18) =0.1073 m=10.73 cm`
At `x =0.25*A =2.6825 cm` the potential energy is
`E_p(x) =(k*x^2)/2 =18*0.026825^2/2 =0.00648 J`
As said above
`E_k(x) +E_p(x) =0.10368 J`
`(m*v(x)^2)/2 =0.0972 J`
`v(x) =sqrt(2*0.0972/0.9) =0.465 m/s =46.5 (cm)/s`
The amplitude of oscillations is `A =10.73 cm` and the speed at x =0.25*A is `v =46.5 (cm)/s`
Further Reading