From the information given in the statement let be
[tex]\begin{gathered} f=\frac{2}{3}s\text{ (1)} \\ f+s=310\text{ (2)} \end{gathered}[/tex]Where
*f: number of students taking a French class
*s: number of students taking a Spanish class
So, you have a system of linear equations, which you can use the substitution method.
To do this, replace the value of the first equation in the second equation and solve for s
[tex]\begin{gathered} f+s=310\text{ (2)} \\ \frac{2}{3}s+s=310 \\ \frac{5}{3}s=310 \\ \text{ Multiply by }\frac{3}{5}\text{ on both sides of the equation} \\ \frac{3}{5}\cdot\frac{5}{3}s=310\cdot\frac{3}{5} \\ s=186 \end{gathered}[/tex]Now,