Let x be the number of cans of corn Alex buys.
Let y be the number of cans of tomatoes Alex buys.
Establish the equations:
Equation 1: x+y=24
Equation 2: 0.40x+0.80y=12.8
Isolate y in equation 1:
y = 24-x
Substitute y= 24-x into equation 2:
0.40x+0.80(24-x)=12.8
0.40x+19.2-0.80x=12.8
-0.40x = -6.4
x=16
Therefore, Alex buys 16 cans of corn.