Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include<iostream>
  2. float bmi(float, float);
  3. int main(){
  4. float weight;
  5. float height;
  6. std::cout << "Input your weight(In pounds)" << std::endl;
  7. std::cin >> weight;
  8. std::cout << "Input your height(In inches)" << std::endl;
  9. std::cin >> height;
  10. bmi(weight, height);
  11.  
  12. return 0;
  13. }
  14. float bmi(float n1,float n2){
  15. float bmin;
  16. bmin = (n1*703)/(n2*n2);
  17. std::cout << "Your BMI is: " << bmin << std::endl;
  18.  
  19. if(bmin <= 18.49){
  20. std::cout << "You are underweight!" << std::endl;
  21.  
  22. }
  23. else if(bmin >=18.5 and <= 25){
  24. std::cout << "You have normal weight!" << std::endl;
  25. }
  26. else if(bmin >=25.01 and <=29.99){
  27. std::cout << "You are overweight." << std::endl;
  28. }
  29. else if (bmin >=30){
  30. std::cout << "You are obese..."
  31. }
  32. }
  33.  
  34. C:UsersFinneganDesktopComputer Science 3-4Computer Sciencefm2-
  35. 2.cpp|23|error: expected primary-expression before '<=' token|
  36.  
  37. C:UsersFinneganDesktopComputer Science 3-4Computer Sciencefm2-
  38.  
  39. 2.cpp|31|error: expected ';' before '}' token|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement