184k views
4 votes
Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the body mass of the visitor. Display the weight, height, and body mass on the screen.

User Leo Yu
by
4.3k points

1 Answer

2 votes

Answer:

weightPound = float(input("Enter your weight in pounds "))

heightInches = float(input("Enter your height in inches "))

weightKg = weightPound*0.453592

heightMeter = heightInches*0.0254

BodyMassIndex = weightKg/(heightMeter*heightMeter)

print("")

print("Your Weight in kilograms is: ")

print(weightKg)

print("Your Height in meters is: ")

print(heightMeter)

print("Your Body Mass Index is: ")

print(BodyMassIndex)

Step-by-step explanation:

  1. Above is a Python Script to accomplish the task
  2. See attached image for the program output.
  3. Observe that we used the formula weight/height*height to calculate the Body Mass Index
  4. Observe also the conversion from pounds to Kilogram and inches to meters
Create a script that asks for the visitor's weight in pounds and his/her height in-example-1
User Kiran Biradar
by
3.4k points