Created
August 9, 2011 22:39
-
-
Save joshmcarthur/1135392 to your computer and use it in GitHub Desktop.
A method to calculate BMI in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Calculations | |
/** <summary>A method to calculate Body-Mass Index (BMI) from a given weight and height</summary> | |
* <param name="weight">The person's weight in kilograms</param> | |
* <param name="height">The person's height in kilograms</param> | |
*/ | |
public decimal CalculateBMI(decimal weight, decimal height) { | |
bmi = Math.pow(weight / height, 2) | |
return Math.round(bmi, 2) | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 5: The person's weight in kilograms?