The first step here is to determine the mass of C in CO2 and the mass of H in H2O. This is done by dividing the atomic mass by the molecular mass and then multiplying by the mass of compound produced.
For C:
(12.011 g / 44.009 g) x 4.40 g = 1.1999 g
For H:
(1.0079 x 2 / 18.0148 g) x 2.70 g = 0.3021 g
The next step is to convert these masses into moles. This is done by dividing the mass by the relative atomic mass of the element:
C: 1.1999 g / 12.011 g mol-1 = 0.0999 mol
H: 0.3021 g / 1.0079 g mol-1 = 0.2997 mol
The final step is to divide each of these two values by the smallest number, in this case this is the number of moles of carbon:
C: 0.0999 mol / 0.0999 mol = 1
H: 0.2997 mol / 0.0999 mol = 3
We therefore have a ratio of 1 carbon atom to 3 hydrogen atoms, thus the empirical formula for this hydrocarbon is CH3.