created by violetgirl
Sat Dec 26 21:08:47 2015
Check out the App to get answer to these questions!
weight = 75.0
height = 1.80
bmi=weight/(height*height)
bmi
[1] 23.14815
healthStatus(bmi)
[1] "keep going with the balanced diet and exercise!"
weight = 200*0.454
height = 1.65
bmi=weight/(height*height)
bmi
[1] 33.3517
healthStatus(bmi)
[1] "see the doctor immediately, you are at your health risk!"
healthStatus <- function(bmi){
if (bmi < 18.5)
status="see the doctor immediately, you are underweight!"
else if (bmi > 18.5 & bmi < 24.9)
status="keep going with the balanced diet and exercise!"
else if (bmi > 25 & bmi < 29.9)
status="consult about the balanced diet and exercise!"
else if (bmi > 30)
status="see the doctor immediately, you are at your health risk!"
return (status) }