Ok you have a set of variables:
var height1 = 10 var height2 = 20 ... var height7 = 70;
The user has given input and you need to get the v
Do you have control over the variables as an array of heights would suit you much better, failing that, create the array yourself so you take height 1..X push them onto an array and then you can just use the index.