If y varies directly as x, that means that y and x are proportional and here after the relation linking them:
y = k.x, where k is the coefficient of proportionality. Let's calculate k (constant):
8 = k.(3) and k = 8/3
Hence the value of y =(8/3).x, when x = 12 is:
y = (8/3).(12) → y = 32