At STP, we have the following data:
To find the mass, we need to find the mol. Based in the formula, we clear the n (mol) and replace the STP values there:
Finally, to find the mass, we use the molar mass where you can find it in the periodic table (C = 12 g/mol and O = 16 g/mol)
For CO2, we do the following calculation :
Doing the conversion from mol to mass (grams):
The mass of CO2 in this sample is 0.34 g.