Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

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

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

Why We Listen?

Answered: 1 week ago