From the question, the two vegetables involved are tomatoes and corn
We have to generate some sets of simultaneous linear equations from the information given in the question.
Let the number of cans of tomatoes be represented by x
and the number of cans of corn be represented by y
Alex bought 24 cans of vegetables. This means;
x + y = 24 ..................................................... equation 1
He paid 80cents ($0.80) for 1 can of tomato.
This means for x cans of tomatoes, he would pay $0.80x
He paid 40cents ($0.40) for 1 can of corn.
This means for y cans of corn, he would pay $0.40x
Alex paid a total cost of $12.8. This means;
0.8x + 0.4y = 12.8 ........................................... equation 2
Hence, we have derived two equations out from the question and we solve them simultaneously
x + y = 24 ........................................................(equation 1)
0.8x + 0.4y = 12.8..........................................(equation 2)
Using substitution method, if x + y = 24
x = 24 - y
Substituting x = 24 - y in equation 2, we have;
0.8(24-y) + 0.4y = 12.8
19.2 - 0.8y + 0.4y = 12.8
Collecting like terms,
19.2 - 12.8 = 0.8y - 0.4y
6.4 = 0.4 y
Since x + y = 24
x + 16 = 24
x = 24 - 16
x = 8
Therefore, x = number of tomato can = 8
y = number of corn can = 16
Hence, the cans of corn he bought are 16cans.