First you need to use the fact that 1 mole of any gas at 298K and 1 atm pressure occupies 24.0 dm3 (or 24000 cm3).
The volume of gas you have used was 240cm3. Hence you have used 240/24000 moles.
When using VOLUME of a gas to calculate moles, you must use molar volume.
Don't try to use molar mass or convert into mass.
When given the MASS, even of a gas, use the molar mass to calculate moles.