We are given two variables, distance and volume of gas required to reach the distance.
We are then asked to find the rate of consumption in miles per gallon.
The approach is simply to divide distance by the volume to get the rate per unit gallon.
This means that for each gallon consumed, 24 miles are covered.
24 mpg