Let the number of boys be 3x and the number of girls be 5x.
It is given that number of girls are 12 more than the number of boys.
⇒ 5x = 3x + 12
⇒ 5x - 3x = 12
⇒ 2x = 12
⇒ x = 6
The total number of students in the class = 3x + 5x = 8x = 8× 6 = 48