Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Wiite a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person is overweight

image text in transcribed
image text in transcribed
image text in transcribed
Wiite a 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 their height. A person's BMI is calculated using the formula: BMI FORMULA USA BMla 703x height in Me The program should ask the user: "Enter your weight in pounds: "Enter your height in inches: "Calculate the BMI using the formula above and display it formatted to 2 digits after the decimal. Display one of the following messages based on the value of the BMl: You are overweight (BMI greater than 25: averweight) "You are underweight (BMI less than 18.5: underweight) Your weight is optimal" (BMI between 18.5 and 25 inclusive: optimal) If any of the values entered by the user are non-numeric, the program should print an error message "invalid value entered" Input Format weight in pounds, height in inches Constraints none Output Format BMI and whether person is optimal, underweight or overweight. Sample Input o 120 63 2e0 Sample Output Enter your weight in pounds: Enter your height in inches: Your Body Mass Indicator is 33.2 You are overweight Sample Input 2 6e 65 Sample Output 2 Enter your weight in pounds: Enter your height in inches: Your Body Mass Indicator is 9.98 You are underweight Sample Input 3 one hundred Sample Output 3 Enter your weight in pounds: invalid value entered. Sample Input 4 120 five one hundred Sample Cupt Enter your weight in pounds: inval id value entered Sample Input 120 Five Sample Output 4 Enter your weight in pounds: Enter your height in inches: invalid value entered. Carrent Buffier (saved localy, edicable) PO Python 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

2 What supply is and what affects it.

Answered: 1 week ago