1. (2 points) Write a personalized BMI calculator in the form of a function call
ID: 669880 • Letter: 1
Question
1. (2 points) Write a personalized BMI calculator in the form of a function called bmi_calculator(). This function prompts the user for their appelation, their first name, their last name, their height in inches, their weight in pounds, and prints a message of the form:
BMI Record for _APPELATION _FIRSTNAME _LASTNAME:
Subject is _X feet _Y inches tall and weighs _Z pounds.
The subject's BMI is _B.
(The words preceded by _ are replaced with the input provided by the user.) Your solution must use a function call to bmi function from question 5.
answer for q5
def bmi(w, h):
return ( (w /(h * h)) * 703 )
Explanation / Answer
def bmi(w, h):
return ( (w /(h * h)) * 703 )
appelation = input("appelation")
fname = input("first name")
lname = input("last name")
height = input("height in inches")
weight = input("weight in pounds")
print "BMI Record for "+appelation+ " "+fname+" "+lname
print "Subject is "+height+" inches tall and weighs "+weight+" pounds"
print "The subject's BMI is "bmi(weight,height)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.