To determine the mass percentage of each element in the compounds, we are going to use the following formula:

In the case of the last element of each compound, we are going to make the subtraction of 100% minus the addition of the other elements.
We are going to assume that we have 1 mole of every substance.
First, we have to determine the molecular weight of each substance:
a. NH3

If we have 1 mole of ammonia, then we have 17 g. Then, we can calculate the nitrogen mass percentage as follows:

Then, we make the subtraction to determine the hydrogen percentage:

Then, the answer is that the nitrogen mass percentage equals 82.4% and the hydrogen one is 17.6%
b. Na2CO3
We repeat the same steps that we did with the ammonia.




Then, the answer is that the sodium mass percentage equals 43.4%, the carbon is 11.3%, and the oxygen one is 45.3%