# A poorly designed version of the BMR case study program. def main(): print("This program reads data for one") print("person and computes their basal") print("metabolic rate and burn rate.") print() person() # Reads the person's height and weight. def person(): print("Enter person 1 information:") height = float(input("height (in inches)? ")) weight = float(input("weight (in pounds)? ")) get_age_sex(height, weight) # Reads the person's age and sex. def get_age_sex(height, weight): age = float(input("age (in years)? ")) sex = float(input("sex (male or female)? ")) report_status(height, weight, age, sex) # Calculates person's BMR and reports their burn rate. def report_status(height, weight, age, sex): bmr = 4.54545 * weight + 15.875 * height - 5 * age if sex.lower() == "male": bmr += 5 else: bmr -= 161 print("Person 1 basal metabolic rate", round(bmr, 1)) if bmr < 1200: print("low resting burn rate"); elif bmr <= 2000: print("moderate resting burn rate") else: # bmr > 2000 print("high resting burn rate")