Question

The formula for calculating BMI is: BMI = (weightInPounds * 703) / (heightInInches * heightInInches) Your...

The formula for calculating BMI is:

BMI = (weightInPounds * 703) / (heightInInches * heightInInches)

Your application should prompt the user to enter a weight (in pounds) and height (feet first, and then inches). Your application must convert the entered feet and inches to total height in inches, calculate the BMI and display the result with 2 decimal digits. If you used the variable BMI to store the result of you calculation, you can output it with this statement:

print("BMI = %.2f" % BMI)

The next chapter provides a lot more information on how to format output values.

Here is a sample test run of the application (your implementation may use different output formatting):

BMI (body mass index) calculator

Enter weight (in lbs.)

180

Enter height (feet first, then inches)

feet   5

inches 10

BMI = 25.82

Homework Answers

Answer #1
print("BMI (body mass index) calculator")
print("Enter weight (in lbs.)")
weightInPounds = float(input())
print("Enter height (feet first, then inches)")
feet = float(input("feet   "))
inches = float(input("inches "))
heightInInches = feet * 12 + inches
BMI = (weightInPounds * 703) / (heightInInches * heightInInches)
print("BMI = %.2f" % BMI)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a modular program that calculates and displays a person’s body mass index (BMI). The BMI...
Write a modular program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula BMI = weight * 703/height2 Where weight is measured in pounds and height is measured in inches. The program should ask the user to enter his or her weight and height and then display the user’s BMI. The...
In Java Write a program that produces the output shown below. Output Enter your weight in...
In Java Write a program that produces the output shown below. Output Enter your weight in pounds:200 Enter your height in feet followed by a space then additional inches:5 7 Your BMI is 31.38992486697179 Your risk category is Obese.
Create a new file named quiz_loops.py. b. Write your name and date in a comment. c....
Create a new file named quiz_loops.py. b. Write your name and date in a comment. c. Write a for loop which will display this set of values 2,4,6,8,10,12,14,16. d. Write a while which will display this set of values 16,13,10,7,4,1,-2. e. Write a for loop which will print ‘Loops are fun’ three times. f. Write a while loop that will prompt you for four numbers. Convert the number to an integer. Compute the power as power = power ** number....
INTRODUCTION: USE if statement, loops Torsion occurs when an object is twisted due to an applied...
INTRODUCTION: USE if statement, loops Torsion occurs when an object is twisted due to an applied torque and is expressed in Pascals (Pa) or psi. Where D is the diameter of the rod in inches, P is the torsion load in pounds, and L is the offset (distance from the edge) in inches, the torsion shear stress is given by: Ts = 16PL/(piD^3) ASSIGNMENT: Write a C program that will first allow the user to enter the diameter of the...
For this assignment, you will be creating a simple “Magic Number” program. When your program starts,...
For this assignment, you will be creating a simple “Magic Number” program. When your program starts, it will present a welcome screen. You will ask the user for their first name and what class they are using the program for (remember that this is a string that has spaces in it), then you will print the following message: NAME, welcome to your Magic Number program. I hope it helps you with your CSCI 1410 class! Note that "NAME" and "CSCI...
Essential Nutrition for Health & Sports 1. Answer following questions according to your personal data: (You...
Essential Nutrition for Health & Sports 1. Answer following questions according to your personal data: (You should list your personal information to use for calculation and the step of calculation of below questions) a) Calculate YOUR Ideal Body Weight (IBW) and percentage (%) IBW? b) What is your BMI? c) What is your waist-to-hip ratio (WHR)? d) Evaluate the result of your % IBW, BMI and WHR. e) You would like to manage your weight within a heathy range, discuss...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...
Questions: 1. (5 marks) Create a VB.NET Console Application that defines a function Smallest and calls...
Questions: 1. Create a VB.NET Console Application that defines a function Smallest and calls this function from the main program. The function Smallest takes three parameters, all of the Integer data type, and returns the value of the smallest among the three parameters. The main program should (1) Prompt a message (using Console.WriteLine) to ask the user to input three integers. (2) Call the built-in function Console.ReadLine() three times to get the user’s input. (3) Convert the user’s input from...
Task #4 Calculating the Mean Now we need to add lines to allow us to read...
Task #4 Calculating the Mean Now we need to add lines to allow us to read from the input file and calculate the mean. Create a FileReader object passing it the filename. Create a BufferedReader object passing it the FileReader object. Write a priming read to read the first line of the file. Write a loop that continues until you are at the end of the file. The body of the loop will: convert the line into a double value...
Program Description A local company has requested a program to calculate the cost of different hot...
Program Description A local company has requested a program to calculate the cost of different hot tubs that it sells. Use the following instructions to code the program: File 1 - HotTubLastname.java Write a class that will hold fields for the following: The model of the hot tub The hot tub’s feature package (can be Basic or Premium) The hot tub’s length (in inches) The hot tub’s width (in inches) The hot tub’s depth (in inches) The class should also...