"k" represents the konstant of proportionality.
If "y varies directly as x" this means that each time x increases or decreases one unit, the value of y gets modified.
How much is the modification of y each time x changes value? That is given by the constant of proportionality k.
You can express this as an equation: y= k*x
For example if k=2, you get that y=2x → meaning that each time x increases 1 unit, y will increase 2.
To calculate the value of k for given values of x and y, knowing that they vary directly you can clear it from the expression:

For x=8 and y=16

Then k=2 when x=8, y=16 and y varies directly as x.