Since the ratios are equivalent
Then,
3/5 = 18/ x
18/12 = x/ y
x represents the gallons of juice consumed for 6th grade
y represents the gallons of juice consumed for 7th grade
[tex]\begin{gathered} \frac{3}{5}=\frac{18}{x} \\ \text{cross multiply } \\ 3x\text{ = 18 }\times5 \\ 3x\text{ = 90} \\ \frac{3x}{3}=\frac{90}{3} \\ x=\text{ 30} \end{gathered}[/tex]For the 6th grade 30 gallons of juice was consumed
[tex]\begin{gathered} \frac{18}{12}=\text{ }\frac{x}{y} \\ \frac{18}{12}=\frac{30}{y} \\ \text{cross multiply} \\ \frac{18y}{18}=\frac{30\times12}{18} \\ y=\frac{360}{18}=\text{ 20} \end{gathered}[/tex]Thus, for 7th grade 20 gallons of juice was consumed