One way I set this word problem up is by using the equation 88-4x=8. X would stand for the amount of classmates in the class, 88 would stand for your total pieces of gum and 8 would stand for the remaining pieces left.
With the equation 88-4x=8 you want to subtract 88 from both sides to get the equation -4x=-80. Last you want to isolate x by dividing -4 on both sides to finally get x=20. 20 people in the class room.