Answer
(a) Magnesium loses 2 electrons to obtain a stable configuration and form a $Mg^{2+}$ cation
Mg to $Mg^{2+}$ + $2e^{-}$
(b) Barium loses 2 electrons to obtain a stable configuration and form a $Ba^{2+}$ cation
Ba to $Ba^{2+}$ + $2e^{-}$
(c) Iodine atom acquires 1 electron to obtain a stable configuration and form a $I^{-}$ anion
I + e- to $I^{-}$
(d) Aluminum loses 3 electrons to obtain a stable configuration and form a $Al^{3+}$ cation
Al to $Al^{3+}$ + $3e^{-}$
Work Step by Step
(a) Magnesium loses 2 electrons to obtain a stable configuration and form a $Mg^{2+}$ cation
Mg to $Mg^{2+}$ + $2e^{-}$
(b) Barium loses 2 electrons to obtain a stable configuration and form a $Ba^{2+}$ cation
Ba to $Ba^{2+}$ + $2e^{-}$
(c) Iodine atom acquires 1 electron to obtain a stable configuration and form a $I^{-}$ anion
I + e- to $I^{-}$
(d) Aluminum loses 3 electrons to obtain a stable configuration and form a $Al^{3+}$ cation
Al to $Al^{3+}$ + $3e^{-}$