publicclassBMI{publicStringtoString(doubleweight,doubleheight){doubleb=weight/(height*height);if(b<20)return“偏瘦”;elseif(b<25)return“正常”;elseif(b<30)return“偏胖”;elseif(b<35)return“肥胖”;elseif(b<40)return“重度肥胖”;elsereturn“极度肥胖”;}}输入55.0,1.75,返回
publicclassBMI{publicStringtoString(doubleweight,doubleheight){doubleb=weight/(height*height);if(b<20)return“偏瘦”;elseif(b<25)return“正常”;elseif(b<30)return“偏胖”;elseif(b<35)return“肥胖”;elseif(b<40)return“重度肥胖”;elsereturn“极度肥胖”;}}输入55.0,1.75,返回结果是()。
正确答案:偏瘦
Tag:软件构造 中国大学MOOC软件构造
时间:2021-12-13 15:14:44
- 上一篇:publicclassBMI{publicStringtoString(doubleweight,doubleheight){doubleb=weight/(height*height);if(b<20)return“偏瘦”;elseif(b<25)return“正常”;elseif(b<30)return“偏胖”;elseif(b<35)return“肥胖”;elseif(b<40)return“重度肥胖”;elsereturn“极度肥胖”;}}输入分别是55.0和1.62
- 下一篇:publicclassBMI{publicStringtoString(doubleweight,doubleheight){doubleb=weight/(height*height);if(b<20)return“偏瘦”;elseif(b<25)return“正常”;elseif(b<30)return“偏胖”;elseif(b<35)return“肥胖”;elseif(b<40)return“重度肥胖”;elsereturn“极度肥胖”;}}输入75.0,1.70,返回