Given height and weight of a person in float, calculate Body Mass index of the person and print respective output based on calculation. Formulae for calculation: [weight (kg) / height (cm) / height (cm)] x 10,000 .For Example: weight =76.7 , height=162.2 BMI=((76.7/162.2)/162.2)X 10,000BMI=(0.4728/162.2)X 10,000 BMI=0.000291X 10,000 BMI=29.1 So, it is Overweight.Print "Underweight" or "Healthy weight" or "Overweight" or "Obesity". Below 18.5 Underweight 18.5 – 24.9 Healthy weight 25.0 – 29.9 Overweight 30.0 and Above ObesityInput Format:Accept two inputs, weight(float) and height(float)Output Format:Print "Underweight" or "Healthyweight" or "Overweight" or "Obesity"Constraints:1<=N<=10^15Sample Input 1:46.5 165.3Sample Output 1:UnderweightSample Input 2:76.7 162.2Sample Output 2:Overweight
Question
Given height and weight of a person in float, calculate Body Mass index of the person and print respective output based on calculation. Formulae for calculation: [weight (kg) / height (cm) / height (cm)] x 10,000 .For Example: weight =76.7 , height=162.2 BMI=((76.7/162.2)/162.2)X 10,000BMI=(0.4728/162.2)X 10,000 BMI=0.000291X 10,000 BMI=29.1 So, it is Overweight.Print "Underweight" or "Healthy weight" or "Overweight" or "Obesity". Below 18.5 Underweight 18.5 – 24.9 Healthy weight 25.0 – 29.9 Overweight 30.0 and Above ObesityInput Format:Accept two inputs, weight(float) and height(float)Output Format:Print "Underweight" or "Healthyweight" or "Overweight" or "Obesity"Constraints:1<=N<=10^15Sample Input 1:46.5 165.3Sample Output 1:UnderweightSample Input 2:76.7 162.2Sample Output 2:Overweight
Solution
To calculate the Body Mass Index (BMI) of a person, we need their weight and height. The formula for calculating BMI is as follows: BMI = (weight (kg) / height (cm) / height (cm)) x 10,000.
Let's take an example to understand the calculation. Suppose the weight is 76.7 kg and the height is 162.2 cm. We can calculate the BMI as follows:
BMI = ((76.7 / 162.2) / 162.2) x 10,000 = (0.4728 / 162.2) x 10,000 = 0.000291 x 10,000 = 29.1
Based on the calculated BMI, we can determine the weight category of the person. The categories are as follows:
- Below 18.5: Underweight
- 18.5 - 24.9: Healthy weight
- 25.0 - 29.9: Overweight
- 30.0 and above: Obesity
Now, let's take the input values and determine the weight category. For example, if the weight is 46.5 kg and the height is 165.3 cm, the BMI can be calculated using the formula mentioned earlier. After calculating the BMI, we can determine the weight category based on the ranges mentioned above.
Similarly, for the second example with weight 76.7 kg and height 162.2 cm, we can calculate the BMI and determine the weight category.
The input format for this problem is to accept two inputs: weight (float) and height (float). The output format is to print "Underweight" or "Healthy weight" or "Overweight" or "Obesity" based on the calculated BMI.
The constraints for this problem are that the weight and height values should be between 1 and 10^15.
Let's solve the first example:
Input: 46.5 165.3
Output: Underweight
Now, let's solve the second example:
Input: 76.7 162.2
Output: Overweight
Similar Questions
The Body Mass Index (BMI) is the ratio of the weight of a person(in kilograms) to the square of the height(in meters)Formula To Calculate Body Mass Index (BMI)BMI = weight / (height x height);Write a JavaScript program that calculates the BMI, and reports the BMI category as per the following table:BMI Category BMIUnderweight below 18.5Healthy 18.6 to 24.9Overweight 25 to 25.9Obese Obese 30 or greaterInput Data
Create a function of name get_bmi() that receive the weight in kilograms and height in centimeter of a person and return his or her Body Mass index (BMI). The function should convert the height to meters before calculating the BMI.Height in meter = height in centimeter / 100BMI = weight in kilogram / (height in meter * height in meter)For example:Test Resultprint("BMI value:", round(get_bmi(60, 160),1))BMI value: 23.4print("BMI value:", round(get_bmi(85, 170),1))BMI value: 29.4
BMI CalculatorCreate an application which calculates BMI (Body Mass Index)Your app should have 2 input boxesTake weight in kgs from userTake height in meters from userBased on entered height and weight calculate BMI of that personHere is the formula for manually calculating BMI BMI = (weight) / (height * height)From the obtained BMI result, display whether the person isUnderWeight - bmi <= 18.4Normal Weight - bmi >= 18.5 && bmi <= 24.9Overweight - bmi >= 25 && bmi <= 29.9Obese - bmi >= 30Hint: use If conditionsSample Output
John is a fitness trainer and needs to calculate the Body Mass Index (BMI) for his clients to assess their health status. Write a program for him that takes the weight in kilograms and height in meters of a client as input, calculates their BMI, and determines if they fall within the healthy range.Note: The healthy range of BMI is 18.5 to 24.9 (both inclusive).Input format :The input consists of two double values: the weight in kilograms and the height in meters.Output format :The first line of output prints "BMI: X" where X is a double value, rounded off to two decimal places.The second line prints one of the following:If the BMI is within the valid range, print "Healthy Range".Otherwise, print "Not in Healthy Range".Refer to the sample output for formatting specificationsCode constraints :10.0 ≤ weight ≤ 300.00.00 ≤ height ≤ 3.00Sample test cases :Input 1 :65.81.75Output 1 :BMI: 21.49Healthy RangeInput 2 :124.31.87Output 2 :BMI: 35.55Not in Healthy Range
Body Mass Index (BMI) is a way of finding out if a person’s body mass falls within a healthy range for their height. Table 1 shows information about two people.Table 1 Person Body mass in kg Height in m BMI in kg/m 2 A631.6523.1 B921.71X The graph below shows five BMI categories for adults. 1. Page 2 of 19(a) Which is the BMI category of person A in Table 1? Tick (✓ ✓ ✓ ✓) one box.Clinically obese Normal Obese Overweight Underweight (1) (b) Calculate value X in Table 1. Use the equation: Give your answer to 3 significant figures. ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ X = _______________ kg/m 2 (3) Page 3 of 19Scientists think there is a link between BMI and life expectancy. Table 2 shows information about predicted life expectancy of men after the age of 50.Table 2 BMI Category Predicted number of years living in good health after the age of 50 Predicted number of years living in bad health after the age of 50 Normal19.064.98 Overweight18.685.32 Obese16.377.08 Clinically obese13.0710.10 (c) Describe two patterns shown in Table 2 about the effects of BMI category. 1 ________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ 2 ________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ (2) The number of people who are obese in the UK is increasing. (d) Explain the financial impact on the UK economy of an increasing number of people who are obese. ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ (2) Page 4 of 19(e) A person who is obese is more at risk of arthritis. Arthritis is a condition that damages joints. Suggest how arthritis could affect a person’s lifestyle. ___________________________________________________________________ ___________________________________________________________________ (1) (f) A person who eats a diet high in saturated fat might become obese. Name two health conditions that might develop if a person eats a diet high in saturated fat. Do not refer to arthritis in your answer. 1 ________________________________________________________________ 2 ________________________________________________________________
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.