上传者: 47767582
|
上传时间: 2022-05-29 12:03:18
|
文件大小: 1KB
|
文件类型: CPP
1.身高预测系统的开发。
题目内容:
研究表明,人的身高与遗传因素有一定的关系。可以按照下面的公式,预测遗传身高(不考虑后天因素)。请据此设计一套身高预测系统,要求配有系统界面,可以支持用户选择性别。
男性成人时身高=(fa_Height + mo_Height)×0.54 cm
女性成人时身高=(fa_Height×0.923 + mo_Height) / 2 cm
这里fa_Height和mo_Height分别表示父亲和母亲的身高,单位均为cm。
以下为程序的运行结果示例1:
*************************************
* Welcome to Use Height Prediction System *
*************************************
Please choose the sex:
1. Female
2. Male
Your choice is: 1↙
May I know your Surname? Ma↙
Hi, Miss Ma!
Could you please input your mother’s height(cm): 153↙
Could you please input your father’s height(cm): 169↙
Your predicted height is 154cm
Thank you for use our “Height Prediction System”!
以下为程序的运行结果示例2:
*************************************
* Welcome to Use Height Prediction System *
*************************************
Please choose the sex:
3. Female
4. Male
Your choice is: 2↙
May I know your Surname? Li↙
Hi, Mr Li!
Could you please input your mother’s height(cm): 162↙
Could you please input your father’s height(cm): 175↙
Your predicted height is 181 cm
Thank you for use our “Height Prediction System”!