Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help! Please use Python code to do this question, thank you. Question: Body Mass Index is a simple calculation using a person's height and weight.

Help! Please use Python code to do this question, thank you.

Question:

Body Mass Index is a simple calculation using a person's height and weight. BMI can be calculated in the Imperial or Metric system.

The imperial BMI formula is your weight in pounds (lbs) divided by your height in inches, squared and then you multiply this figure by a conversion factor of 903.

The metric formula is BMI = kg/m2 where kg is a person's weight in kilograms and m2 is their height in meters squared.

A BMI of 35.0 or more is overweight, while the healthy range is 28.5 to 34.9.

For our program, we will let the user choose whether to use the Imperial or Metric system. After the user enters the weight and height, the program will report the BMI, as well as a message indicating overweight, healthy, or abnormal BMI. At this moment its okay to crash the program if a user fails to enter proper whole numbers. However, the program should avoid a divide-by-zero error by printing out an error message in this case.

Testing requirements: You need to provide at least six test runs. At least two test runs for using the Imperial system, one normal and one overweight case. Similarly, two test runs for using Metric systems. At least two additional test runs for abnormal cases, e.g. divide-by-zero or negative BMI (either system, of your choices).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions