Answer
Please see the work below.
Work Step by Step
We know that
a. The cathode reaction is given as
$Mg^{+2}+2e^{-}\rightarrow Mg(I)$
the anode reaction is
$2Br^{-}(l)\rightarrow Br_2(l)+2e^{-}$
b. The cathode reaction is
$Ca^{+2}(l)+2e^{-}\rightarrow Ca(l)$
The anode reaction is
$4OH^{-}\rightarrow O_2+2H_2O(g)+4e^{-}$