from the problem we now there were 98 passengers
let X = coach seats and Y equal sleeper car seats
so number of seats sold would be x + y = 98, which to solve for x can be rewritten as x = 98 -y
we know coach seats cost 128 and sleeper car seats cost 286
so we would multiply the cost of the seat by the number of seats to get a total cost
so 128x = total coast for coach and 286 = total for sleeper cars
we also know the total value is 20,128
so 128x + 286y = 20,128
replace x in that equation with the subtraction one from above:
128(98-y) + 286y = 20,128
now distribute the 1st part of the equation by multiplying 128 by 98 and by y
12,544 - 128y + 286y = 20,128
combine the like terms ( the two which have Y in them)
12,544 + 158y = 20,128
subtract 12,544 from both sides of the equation:
158y = 7584
divide both sides by 158 to solve for y
y = 7584 / 158 = 48
there were 48 sleeper car seats sold
and 98 - 48 = 50 coach seats sold