See the attached picture:
T = 30
A = 4c
A + c = T
Anna Claire has 6 pencils. Times 4 makes Ally's pencil count. 4 * 6 = 24
24 + 6 = 30. So, you answer is: Ally has 24 pencils.
If there is 8 boys then there is 12 girls because 2x4=8 boys so 3x4=12 girls.