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.選擇哪種方式來計(jì)算
\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.根據(jù)選擇的方式輸入體重和身高(磅和英尺,或千克和米)
\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 < 18.5
Normal if 18.5 ≤ BMI < 25.0
\x09\x09\x09
Overweight if 25.0 ≤ BMI < 30.0
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.
誰(shuí)知道這個(gè)c++的code要怎么寫,code中需要用到system和category.
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.選擇哪種方式來計(jì)算
\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.根據(jù)選擇的方式輸入體重和身高(磅和英尺,或千克和米)
\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 < 18.5
Normal if 18.5 ≤ BMI < 25.0
\x09\x09\x09
Overweight if 25.0 ≤ BMI < 30.0
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.
誰(shuí)知道這個(gè)c++的code要怎么寫,code中需要用到system和category.
其他人氣:230 ℃時(shí)間:2020-09-11 21:02:39
優(yōu)質(zhì)解答
#include <iostream>#include <string>#include <stdlib.h>using namespace std;class person {//新建人物類public: person();...
我來回答
類似推薦
- 英語(yǔ)翻譯
- 將粉筆頭輕放在以2m/s運(yùn)動(dòng)的傳送帶上,傳送帶留下一條長(zhǎng)度為4米的劃線.請(qǐng)問,為什么劃線的長(zhǎng)度等于傳送帶的位移減去物體的位移?請(qǐng)?jiān)斀?
- <<湯姆索亞歷險(xiǎn)記>>以什么為線索,鞭撻了什么?
- 桂花雨主要內(nèi)容?30字以上
- 誰(shuí)能幫我想個(gè)詞來形容這個(gè)人
- (找等量關(guān)系列方程)
- 等比數(shù)列{an}中,a1+a2=8,a3-a1=16,則a3等于( ?。?A.20 B.18 C.10 D.8
- 根據(jù)句意及首字母提示完成字母
- on foot是什么詞(動(dòng)詞還是.)
- ﹙1-1/2²﹚﹙1-1/3²﹚...﹙1-1/2013²﹚
- 高三數(shù)列題急求
- 20*20*1.5方管理論重量是多少?20*40*2.0矩管理論重量是多少?
猜你喜歡
- 1自天然藥物提取液中識(shí)別生物堿是否存在的主要反應(yīng)及其試劑有哪些
- 2已知函數(shù)f ( x )等于(cos x)的四次方減去2sin xcos x減去(sin x)的四次方.1)求f ( x ) 的最小正周期;...
- 3在9 8 7 6 5 4 3 2 1=20添上加減乘除使等式成立
- 4用“攛掇”“絮叨”“怠慢”造句
- 5△ABC中,B>90° a=2x-5 b=x+1 c=4 求 x的取值范圍.
- 6Experience more than sufficiently teaches that men govern nothing with more difficult than their tongues.問govern sth wit
- 7氧化銅與稀硫酸反應(yīng)的化學(xué)方程式
- 8為什么高中化學(xué)先學(xué)的離子反應(yīng)再學(xué)氧化還原反應(yīng) 離子反應(yīng)里面有好多寫的時(shí)候要用到氧化還原的知識(shí)的啊
- 9已知:關(guān)于x的方程kx^2-(4k+1)x+3k+3=0
- 10語(yǔ)文作文:如何審題?如何理解話題?
- 11先生的讀音,生是讀一聲還是輕聲
- 12額定電壓220V、容量100L、電阻24.2Ω的電熱水器,它的電功率是多少?