# This program finds the basal metabolic rate (BMR) for two # individuals. This version is unstructured and redundant. def main(): print("This program reads data for two") print("people and computes their body") print("mass index and weight status.") print() # prompt for first person's information print("Enter person 1 information:") height1 = float(input("height (in inches)? ")) weight1 = float(input("weight (in pounds)? ")) age1 = float(input("age (in years)? ")) sex1 = input("sex (male or female)? ") print() # calculate first person's BMR bmr1 = 4.54545 * weight1 + 15.875 * height1 - 5 * age1 if sex1.lower() == "male": bmr1 += 5 else: bmr1 -= 161 # prompt for second person's information print("Enter person 2 information:") height2 = float(input("height (in inches)? ")) weight2 = float(input("weight (in pounds)? ")) age2 = float(input("age (in years)? ")) sex2 = input("sex (male or female)? ") print() # calculate second person's BMR bmr2 = 4.54545 * weight2 + 15.875 * height2 - 5 * age2 if sex2.lower() == "male": bmr2 += 5 else: bmr2 -= 161 # report results print("Person 1 basal metabolic rate", round(bmr1, 1)) if bmr1 < 1200: print("low resting burn rate"); elif bmr1 <= 2000: print("moderate resting burn rate") else: # bmr1 > 2000 print("high resting burn rate") print("Person 2 basal metabolic rate", round(bmr2, 1)) if bmr2 < 1200: print("low resting burn rate"); elif bmr2 <= 2000: print("moderate resting burn rate") else: # bmr2 > 2000 print("high resting burn rate") main()