C++,输入体重,身高,算bmi

问题描述:

C++,输入体重,身高,算bmi
1.Ask for the user for his first name.输入你的姓名
\x09\x09\x09\x09
\x09\x09\x09\x09
\x09\x09\x09\x09\x09
2.Ask the user whether he wants to use metric or standard system.选择哪种方式来计算
\x09\x09\x09\x09
\x09\x09\x09\x09
\x09\x09\x09\x09\x09
3.Based on the choice of the system,prompt to ask weight and height.Use the answer
\x09\x09\x09\x09\x09
and the appropriate formula to calculate the user’s bmi.根据选择的方式输入体重和身高(磅和英尺,或千克和米)
\x09\x09\x09
\x09\x09\x09\x09
\x09\x09\x09\x09\x09
4.Prints out to the user (addressed with his name) what his BMI is.输出,用户的姓名和bmi的值
\x09\x09\x09\x09
\x09\x09\x09\x09
\x09\x09\x09\x09\x09
5.Prints out which category of weight he belongs to depending on his BMI.输出,用户的姓名,和更具bmi的值用户的体重属于哪一类的.
BMI = weight (kg) /( (height (m))(height(m))
BMI = weight (lb) / ((height (in)(height(in))*703
\x09\x09\x09
Underweight if BMI Normal if 18.5 ≤ BMI \x09\x09\x09
Overweight if 25.0 ≤ BMI Obese if 30.0 ≤ BMI
\x09\x09
Here are two sample output
\x09\x09\x09
v:\cmpsc101
Type your first name (with no space):
Michael
Type metric for metric system,type standard for standard system:
standard
Type in your weight in pound and your height in inch:
180
70.5
Michael,your BMI is 25.4595
Michael,you are considered to be Overweight.
\x09\x09\x09
v:\cmpsc101
Type your first name (with no space):
John
Type metric for metric system,type standard for standard system:
metric
Type in your weight in kilogram and your height in meter:
25
1
John,your BMI is 25
John,you are considered to be Overweight.
\x09\x09\x09
v:\cmpsc101
Type your first name (with no space):
Dora
Type metric for metric system,type standard for standard system:
unknown
Type in your weight in pound and your height in inch:
100
65.2
Dora,your BMI is 16.5371
Dora,you are considered to be Underweight.
谁知道这个c++的code要怎么写,code中需要用到system和category.

#include <iostream>#include <string>#include <stdlib.h>using namespace std;class person {//新建人物类public:    person();...