Heptane is $\ce{CH3-CH2(5)-CH3}$
Octane is $\ce{CH3-CH2(6)-CH3}$
Given combustion enthalpies for each of $-4816$ and $-5470~\mathrm{kJ~mol^{-1}}$ respectively, we now have a simple set of algeraic equations:
5A + 2B = $-4816~\mathrm{kJ~mol^{-1}}$
6A + 2B = $-5470~\mathrm{kJ~mol^{-1}}$
First we can solve for A as the combustion enthaply of a CH2 in a linear hydrocarbon and we get the value $-654~\mathrm{kJ~mol^{-1}})$.
We can now solve for B,
In the first equation we get 2B = ($-4816 - (654 * 5)~\mathrm{kJ~mol^{-1}}$, A = $-773~\mathrm{kJ~mol^{-1}}$
In the second equation we get 2B = ($-5470 - (654 * 6)~\mathrm{kJ~mol^{-1}}$ , A = $-773~\mathrm{kJ~mol^{-1}}$
dodecane has CH3-CH2(10)-CH3 , for 10A + 2B.
10 * A + 2 * B = ($-6540$ + $-1546$)$~\mathrm{kJ~mol^{-1}}$ = $-8086~\mathrm{kJ~mol^{-1}}$