Body Mass Index
Design a modular program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula:
#When i run this code, my introduction does not show up first.
#“Please enter your height in inches.” comes up first")
#How do i fix this?
#I need at least two functions including the def #main():
def main(): bmi_intro() #define variables get_height = 0.0 get_weight = 0.0 body_mass_index = 0.0 #We will start with the introduction to our program def bmi_intro(): print("Welcome to my BMI calculator!") print("If you can tell me your weight and height") print("I can tell you your Body Mass Index") print("Let's Go!\n") #From this point I will ask the user for his/her information. get_height = float(input("Please enter your height in inches. ")) get_weight = float(input("Please enter your weight in pounds. ")) #user will enter there information above and we will then calcualte. body_mass_index = (get_weight * 703) / (get_height ** 2) if body_mass_index < 18.5: print("A person with a BMI of " + str(body_mass_index ) + " is underwieght ") elif body_mass_index < 24.9: print("A person with a BMI of " + str(body_mass_index ) + " is normal weight ") else: print("A person with a BMI of " + str(body_mass_index ) + " is overweight ") main()