I will have to assume that they were all moving in the same direction.
Momentum is conserved here, energy is not.
Initial momentum
4*5 + 10*3 + 3*4 = 62 kg m/s
final momentum
(4+10+3)v = 17 v
so
17 v = 62
v = 3.64
However I do not think they will collide if they are all moving in the same direction at the beginning. After the 4 kg mass catches up and joins the 10 kg mass, the two together are unlikely to catch the 3 kg mass. I have a hunch something is wrong with your problem statement
three carts of masses 4.0kg, 10kg, and 3.0kg move on a frictionless horizontal track with speeds of 5.0m/s, 3.0m/s, and 4.0m/s. The carts stick together after colliding. find the velocity of the three carts.
2 answers
Your 3rd velocity should be -4m/s. making it 4*5 + 10*3 - 3*4 = 38
17v = 38
v = 2.24m/s
17v = 38
v = 2.24m/s