There are two prices for different types of gas:
$2.30 per gallon of regular gas, and
$2.80 per gallon of premium gas.
At the end of the day 290 gallons were sold, and the receipts totaled $702.
We are asked how many gallons of each gas were sold. Since these are our unknowns, we named them:
gallons of regular: R
gallons of premium : P
So we create two equations:
Equation 1: P + R = 290
since we know that the total number of gallons sold was 290
Equation 2: 2.3 R + 2.8 P = 702
where we add the $ amounts produced by selling R gallons of the regular (priced at $2.30 per gallon) --> 2.30 * R = 2.3 R
and P gallons of the premium (priced at $2.8 per gallon) --> 2.80 * P = 2.8 P
Now, we use equation 1 to solve for one of the unknown, let's say solve for P:
P = 290 - R
we use this as our "substitution equation" which allows us to replace p with (290 - R) in the second equation:
2.3 R + 2.8 (290 - R) = 702
now we solve for R:
2.3 R + 812 - 2.8 R = 702
we combine the terms on R on the left:
-0.5 R + 812 = 702
now we subtract 812 from both sides:
-0.5 R = 702 - 812
-0.5 R = -110
R = 220 gallons
Then we find the number of gallons for the premium by using the substitution equation:
P = 290 - R = 290 - 220 = 70 gallons
So there were 220 gallons of regular sold, and 70 gallons of premium gas.