If that is what the question said, then the empirical formula of the hydrocarbon is C_7H_16. How do we know?
(i) We assume a mass of 100*g of hydrocarbon.
(ii) We work out its atomic composition on the basis of the atomic percentages:
"Moles of carbon" -= (84.0*g)/(12.01*g*mol^-1)=7*mol
"Moles of hydrogen" -= (16.0*g)/(1.00794*g*mol^-1)=16*mol
How did I know that there were 16*g of hydrogen based solely on the GIVEN "% percentage composition of carbon?"
On this basis, the empirical formula, the simplest whole number representing constituent atoms in a species is C_7H_16. Clearly the molecular formula is identical.
It is a fact that the "molecular formula" is always a whole number multiple of the "empirical formula".
Thus "molecular formula" = nxx"empirical formula". But we have been given an estimate of molecular mass. So.............
So 100*"amu"-=(C_7H_16)xxn
Thus 100*"amu"-=(7xx12.011+16xx1.00794)*"amu"xxn
We solve for n (how), and find n-=1.
"And thus the molecular formula"-=C_7H_16.
See [here for another example.](https://socratic.org/questions/saccharin-has-the-composition-45-90-c-2-75-h-26-20-o-17-50-s-and-7-65-n-what-is-)