In order to compute the mass of MgO formed, Niven must first convert grams of Mg to moles.
The chemical reaction equation provides a ratio between the moles of magnesium and magnesium oxide. Thus, in order to determine the amount of MgO formed, the amount of Mg reacted must be known.
Solving:
Moles Mg = 28 / 24 = 1.17
Moles of MgO = 1.17
Mass of MgO = 1.17 * 40.3
Mass of MgO = 47.2 grams