Input a constant

I am working on a transformation activity. In a graph box I have g(x)= af(x). I want students to be able to input a value for a in an input box and see what happens to the graph. How do I link the input value to the graph.

Something like this?

That is perfect thanks.