Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import math
  2. import sys
  3. print("King's BMI Calculator")
  4.  
  5.  
  6. def h():
  7. global height
  8. height=float(input("Please enter student's height in inches:"))
  9. return height
  10.  
  11. def w():
  12. global weight
  13. weight=float(input("Please enter student's weight in pounds:"))
  14. return weight
  15.  
  16. def bmi():
  17. global total
  18. total=((str(weight) * 703)/(str(height) * str(height)))
  19. return total
  20.  
  21. def printbmi():
  22. print(name + "'s BMI Profile")
  23. print("Height:", str(height), "inches")
  24. print("Weight:", str(weight), "lbs")
  25. print("BMI Index:" + str(float(round(total, 1))))
  26. return
  27.  
  28. def main():
  29. h()
  30. w()
  31. printbmi()
  32.  
  33. while True:
  34. name = input("Please enter student's name or press 0 to quit:")
  35. if name == "0":
  36. break
  37.  
  38. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement