P = potato C = corn
3P + 4C = $40
5P + 2C = $34
Multiply -2 to the 2nd equation to get
-10P - 4C = -68
Add it to the 1st equation
3P + 4C = 40
-10P - 4C = -68
-----------------------
-7P = -28
Solve for P
P = $4
Substitute 4 into P(potato) to find what C(corn) is