Total number of students in class = 42
Let's assume the number of boys in class = x
Then number of girls in the class = (42 - x)
According to the question
3x/4 + 2(42 - x)/3 = 30
⇒ 3x/4 + 28 - 2x/3 = 30
⇒ 9x/12 - 8x/12 = 30 - 28
⇒ x/12 = 2
⇒ x = 2 × 12 = 24
Hence, number of boys in class = 24
Number of girls coming to school by bus = 2(42 - 24)/3 = 12