6x miles, I gather it means, six times the 18 miles, or 6 * 18 miles
and 18x I gather it means, 18 * 27 miles for the highway
thus
[tex]\bf \begin{array}{ccllll}
City\\
miles&gallons\\
\textendash\textendash\textendash\textendash\textendash\textendash&\textendash\textendash\textendash\textendash\textendash\textendash\\
18&1\\
6\cdot 18&x
\end{array}\implies \cfrac{18}{6\cdot 18}=\cfrac{1}{x}\impliedby \textit{solve for "x"}
\\
----------------------------\\
[/tex]
[tex]\bf \begin{array}{ccllll}
Highway\\
miles&gallons\\
\textendash\textendash\textendash\textendash\textendash\textendash&\textendash\textendash\textendash\textendash\textendash\textendash\\
27&1\\
8\cdot 27&x
\end{array}\implies \cfrac{27}{8\cdot 27}=\cfrac{1}{x}\impliedby \textit{solve for "x"}[/tex]