i googled the algorithm. try this:

BMIValue = (weight) / (height ^ 2)