The chemical formula for n-octane is C8H18. Using this formula we can calculate octane's MW: (Carbon) 8*12 = 96; (Hydrogen) 1*18 = 18. 96 + 18 = 114 g/mol = MW of octane.
To calculate the number of moles of n-octane divide the mass of octane (3.4g) by its MW. 3.4g/114g*mol^-1 = 29.8 *10^-3 moles (mmol).
For combustion of octane remember the stochiometry:
2 C8H18 + 18 O2 -> 36 H2O + 16 CO2
For each molecule of octane there is a possibility of producing 9 waters: 18 Hydrogen atoms in octane / 2 hydrogen atoms in water. A 100% yield of combusted n-octane is 9 * 29.8 mmol = 268 mmol H20 and 8 * 29.8 moles carbon = 238 mmol CO2.
The amount of oxygen gas atoms is 6.8 g / 16 g *mol -1 = 425 mmol. Note oxygen gas is the diatomic O2. However what of interest is the number of oxygen atoms, not molecules.
Oxygen is limiting in this reaction because the water requires 1 atom oxygen * 268 mmol H20 + 2 atoms oxygen * 238 mmol CO2. This requires 744 mmol oxygen atoms. Therefor the reaction can only go to 57% of completion before exhausting the supply of oxygen.
Water has a MW of 18g/mol. 1.79g of water divided by 18 g/mol = 99.4 mmol.
The maximum theoretical yield of water is 268 mmol * 57% = 152.76 mmol. To determine the yield divide the moles of water by the theoretical max yield: 99.4 mmol / 152.76 mmol = 65.1 % yield.