I think this is about elastic collision so use the formula m1vi1 + m2vi2 = m1vf1 + m2vf2,
so the given in this problem is:
m1 = 0.5kg
vi1 (initial velocity 1) = 8m/s
vf1 (final velocity of 1st ball= 12 m/s
m2= 0.8kg
vi2= 10m/s
vf2 = (what you're looking for)
so just input the values on your calculator and you're done:)
also for the direction, i think it's dependent on the sign of the answer:)))))