40.1 g
For this problem, we need to realize that the atomic weight of each element is the number of grams that Avogadro's number of atoms of that element would mass. So let's look up the atomic weight of the elements involved and the ratio of their weights will be the same as the ratio of the masses.
Atomic weight magnesium = 24.305
Atomic weight calcium = 40.078
moles Mg 24.3 g / 24.305 g/mol = 0.999794281 mol
grams Ca = 0.999794281 mol * 40.078 g/mol = 40.06975519 g
Rounding to 3 significant figures gives 40.1 g