We know that one gallon is equal to four quarts, then we have that:
[tex]24\frac{\text{ miles}}{\text{ gallon}}\cdot\frac{1\text{ gallon}}{4\text{ quarts}}=6\frac{\text{ miles}}{\text{ quart}}[/tex]Therefore we have that 24 miles per gallon is the same as 6 miles per quart.