This is actually very common in chemistry -- and very easy.
The equation for combustion of a hydrocarbon is
You have 21.83 grams of CO2 and 4.47 grams of water.
1. Determine the number of
moles of CO2 that were produced (0.496)
2. Determine the number of
moles of H2O that were produced (0.248)
3. From m and n, you can determine the
empirical formula of CnHm. Using the equation given above, you can determine fractions for the values of m and n. They might be something like m=0.443 and n = 0.22. The usual exercise is to divide both numbers by the smaller to get a 1 for the smaller number and another number for the larger one. 0.22/0.22 = 1; 0.443/0.22 = 2.01 So, the empirical formula in my example would be CH2. You might come out with something like 1:1.5. You'd then know that the empirical formula would have to be C2H3.
For the second question, you know the amount of heat that's produced, so you work out the amount of heat per "formula weight" using the formula that you determined.