Let x be the number of students on Alberto's class. Since he gave two pieces to each student, the total number of pieces of gum that he gave was 2x.
The number of pieces remaining after giving 2x of them, is 70-2x. This must be equal to 8. Then, we can represent the situation using the following equation:
[tex]70-2x=8[/tex]Solve for x:
[tex]\begin{gathered} \Rightarrow-2x=8-70 \\ \Rightarrow-2x=-62 \\ \Rightarrow x=\frac{-62}{-2} \\ \Rightarrow x=31 \end{gathered}[/tex]Then, there are 31 students in his class.