GIVEN:
m of CO2=28 g
Molecular Weight of C=12 g/mol
O=16 g/mol
To get the molecular weight of CO2 just add the molecular weights of each element and then multiply them by the number of atoms of each element. In this problem CO2, C has only one atom and O has two atoms in the compound. Therefore, getting molecular weight would be like this:
Molecular weight of CO2=12 g/mol+2(16 g/mol)=44g/molofCO2
Now we have the molecular weight of the compound and the given mass of compound which is 28 g. Therefore we could solve for the number of moles of CO2 in 28 g of CO2.
Using Dimensional Analysis
28 gCO2×1 molCO2/44 gCO2=0.636 mol of CO2
For further readings use General Chemistry by Raymond Chang 10th ed chapter 3 page 87 and for dimensional analysis chapter 1 page 27