public static string MapBmiToDesignation(BodyMassIndex bmi) { if (bmi.Bmi < 18.5M) { return("underweight"); } if (bmi.Bmi >= 25) { return("overweight"); } return("healthy"); }
public BodyMassIndexReport(string height, string weight) { this.Height = height; this.Weight = weight; var validation = new AllValidation(); var areValidInputs = validation.IsValid(this); if (!areValidInputs) { return; } IsValid = true; var dWeight = GeneralValidation.MapStringToDecimal(weight); var dHeight = GeneralValidation.MapStringToDecimal(height); BmiCalculator = new BodyMassIndex(dHeight, dWeight); }
public string TestMapBmiToDesignation(decimal height, decimal weight) { var bmi = new BodyMassIndex.BodyMassIndex(height, weight); return(BodyMassIndexReport.MapBmiToDesignation(bmi)); }
public static string FormatBmiMessage(BodyMassIndex bmi) => $"For the given height: {bmi.Height} and weight: {bmi.Weight}, the BMI is {bmi.Bmi} and the designation is: {MapBmiToDesignation(bmi)}";