Answer:
30 bags of Candy and 10 Sodas
Explanation:
We know that:
C + S = 40 [total of 40 bags and bottles]
The total price is expressed as:
$4C + $3S = $130 [The unit price times the number of items for both]
Dropping the $ for convenience (I'm lazy), we have two equations and two unknowns. A solution is possible.
----
Rearrange one of the two equations to solve for one of the two variables. I'll use C + S = 40 and isolate C:
C = 40 - S
Now use this definition of C in the second equation:
4C + 3S = 130
4(40 - S) + 3S = 130
160 - 4S + 3S = 130
-S = -30
S = 30
From C + S = 40 we can find that S = 10
==========
CHECK
Do 30 bags of Candy and 10 Sodas add to $130??
30*($4) + 10*($3) = $130??
$120 + $30 = $130 ??? YES