Roy bought a new battery-gasoline hybrid car. On a trip the car ran exclusively on its battery for the first $40$ miles, then ran exclusively on gasoline for the rest of the trip, using gasoline at a rate of $0.02$ gallons per mile. On the whole trip he averaged $55$ miles per gallon. How long was the trip in miles?
$\mathrm{(A)}\ 140 \qquad \mathrm{(B)}\ 240 \qquad \mathrm{(C)}\ 440 \qquad \mathrm{(D)}\ 640 \qquad \mathrm{(E)}\ 840$
We know that $\frac{\text{total miles}}{\text{total gas}}=55$. Let $x$ be the distance in miles the car traveled during the time it ran on gasoline, then the amount of gas used is $0.02x$. The total distance traveled is $40+x$, so we get $\frac{40+x}{0.02x}=55$. Solving this equation, we get $x=400$, so the total distance is $400 + 40 = \boxed{440 \ \mathbf{(C)}}$.