Let's define the next variables:
v: number of students in a van
b: number of students in a bus
The senior class for high school A rented and filled 8 vans and 8 buses with 240 students, that is,
8v + 8b = 240 (eq. 1)
High school B rented and filled 4 vans and 1 bus with 54 students, that is,
4v + b = 54 (eq. 2)
Isolating b from equation 2,
4v + b = 54
b = 54 - 4v
Replacing this result into equation 1,
8v + 8(54 - 4v) = 240
8v + 8(54) - 8(4v) = 240
8v + 432 - 32v = 240
-24v + 432 = 240
-24v = 240 - 432
-24v = -192
v = -192/-24
v = 8
Then,
b = 54 - 4(8)
b = 54 - 32
b = 22
There are 8 students in each van, and 22 students in each bus