Question: # Proj 4 _ Q 2 _ Carpenter.py # A program to convert the student's BMI. # By: Melissa Carpenter # Function to convert height
# ProjQCarpenter.py
# A program to convert the student's BMI.
# By: Melissa Carpenter
# Function to convert height from feet and inches to inches
def heightToInchesfeet inches:
heightinches feet inches
return heightinches
# Function to calculate BMI
def calculateBMIheightinches, weight:
bmi weight heightinches
return bmi
def main:
feet floatinputInput your heightin feet:
inches floatinputInput your heightin inches:
# Finding height and weight
height hi hf
weight floatinputInput your weightin pounds:
# Calling BMI
bmiVal weight height height
# Printing BMI
print
BMI: strbmiVal
# Evaluating BMI
if bmiVal : printYou are below the healthy BMI range."
elif bmiVal and bmiVal : printCongratulations You have a healthy BMI."
elif bmiVal and bmiVal : printYou are above the healthy BMI range."
else: printYou are obese!"
main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
