Answer:
yellow = 5 bags
red = 4 bags
Step-by-step explanation:
two equations can be derived from the question
x + y = 9 equation 1
6x + 7y = 59 equation 2
where x = number of red onion bags
y = number of yellow onion bags
Multiply equation 1 by 6
6x + 6y = 54 equation 3
subtract equation 3 from 2
y = 5
substitute for y in equation 1
x + 5 = 9
x = 9 - 5
x = 4