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
The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is...
The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy weight for a given height. The formula is as follows:                 bmi = kilograms / (meters2)                 where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less than 18.5 Normal 18.5 or more, but less than 25.0 Overweight 25.0 or more, but less than 30.0 Obese 30.0...
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.
Please write it in c# program please and if possible no arrays only loops Loop Introduction...
Please write it in c# program please and if possible no arrays only loops Loop Introduction Assignment Using the conditions below, write one program that calculates a person’s BMI. Your main() function will call functions 1, 2, and 3. Your program will contain three functions: Function #1: Will ask the user for their weight in pounds and their height in inches.   Your function will convert the weight and height into Body Mass Index (BMI). The formula for converting weight into...
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...
Selection control structure The if statement The switch statement (optional) Relational operators and logical operators Use...
Selection control structure The if statement The switch statement (optional) Relational operators and logical operators Use of relational and logical operators to check numeric ranges User friendly Use of user friendly user prompt and simple input validation Use of meaningful output labels and format Use of output manipulators Working with string type Use of getline() Project Description There are two main systems for measuring distance, weight and temperature, the Imperial System of Measurement and the Metric System of Measurement. Most...
Your assignment is to implement a computer program in C++ to implement the below application. According...
Your assignment is to implement a computer program in C++ to implement the below application. According to Dummies.com the following algorithm determines the amount of paint you need to paint the walls of a four-sided room: 1. Add together the length of each wall. (For example, if each of the four walls are 14, 20, 14, 20 feet respectively then the total length is 14 + 20 + 14 + 20 = 68 feet) 2. Multiply the sum by the...
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...
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...
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...
c++ Program Description You are going to write a computer program/prototype to process mail packages that...
c++ Program Description You are going to write a computer program/prototype to process mail packages that are sent to different cities. For each destination city, a destination object is set up with the name of the city, the count of packages to the city and the total weight of all the packages. The destination object is updated periodically when new packages are collected. You will maintain a list of destination objects and use commands to process data in the list....
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT