Firstly, you need to understand that mass= moles x relative formula mass. Using this equation and the understanding of the periodic table, you can work out the relative atomic mass of carbon which is 12 and the relative atomic mass of oxygen which is 16. Therefore, the relative formula mass is: 12+16+16=44. Therefore, using the equation, we can rearrange it so that moles= mass/ Mr. This means that 22/44=0.5. Consequently, there are 0.5 moles of carbon dioxide.