I need some help.

I am not quite sure how to know what sign criteria to use in the conservation of momentum equation. For instance, this exercise really confused me: 

[![problem](https://i.stack.imgur.com/4L1qm.png)](https://i.stack.imgur.com/4L1qm.png)

Here, when I see the solution to the problem to find the velocity of the cart A, they do the following:
$$v-v\_A=v'=3\frac ms$$so that $v\_A = v-3$. Up until now I agree with all signs. However, then they say that by momentum conservation, $$0=mv+m\_Av\_A$$ My question is, why is this not $$0=mv-m\_Av\_A$$since the boy and the cart have opposite signed directions for their velocities? Why are the signs taken into account in the first equation and not in the second one?

I am really confused, because in other exercises that are mixed with Kinematics, they do take the signs into account.

All help greatly appreciated.