Question
I need to convert this Python program into a C++ program. # List of categories. category = ['under weight', 'normal', 'over weight', 'obesity','Seriously obese'] #
I need to convert this Python program into a C++ program.
# List of categories. category = ['under weight', 'normal', 'over weight', 'obesity','Seriously obese']
# Ask for values weight = float(input('Please enter your weight in kg : ')) height = float(input('Please enter your height in cm : '))
# convert height to meters height = height/100 # calculate bmi value bmi = weight / (height * height)
if bmi < 18.5: weight_class = category[0] elif bmi < 24.9: weight_class = category[1] elif bmi < 29.9: weight_class = category[2] elif bmi<34.9: weight_class = category[3] else: weight_class=category[4]
# Output print('Your BMI is', bmi, ' and weight class is: ', weight_class)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started