Problem 3: Write a program to calculate Body Mass Index (BMI) and display a message about the diagnosis of BMI. The program prompts the user to input his/her valid height in cm (height >30 cm) and valid weight in lb (weight > 51 lb). The program then converts units from cm to m, and from lb to kg. BMI is calculated as $BMI = \frac{weight(KG)}{height(m)^2}$. The program displays a message according to the values of the diagnosis of BMI as follows:
BMI Message
BMI<18.5 Under weight
18.5<= BMI <=25 Congratulations, you have an ideal weight
BMI>25 Over weight
Input/Output Samples:
Enter weight in lb and height in cm: 5 6
Your weight or height is incorrect
Enter weight in lb and height in cm: 120 180
your weight in KG = 54
your height in M = 1.8
your BMI is 16.6667 and you are under weight
Enter weight in lb and height in cm: 175 185
your weight in KG = 78.75
your height in M = 1.85
your BMI is 23.0095. Congratulations, you have an ideal weight!
Enter weight in lb and height in cm: 200 180
your weight in KG = 90
your height in M = 1.8
your BMI is 27.7778, and you are over weight