abcfdaw 2020-06-09 15:25 采纳率: 100%
浏览 148
已采纳

C语言程序设计 急求 可以完成部分任务也可以!

设计一个健康评估软件,作为公益项目。

根据一个人的身高,体重,运动能力,肺活量等外在的指标,对一个人的健康状况进行量化评估。80分以上为健康,60分以上健康状况一般,60分以下为不健康。

具体评分细则:

男同胞

体重指数(体重(kg)/身高(m)2):(25%)

17-23: 100分

23-28:80分

小于17:70分

28以上:60分

肺活量:(35%)

小于3000:30分

3000-4000:60分

4000-4800:80分

4800以上:100分

引体向上:(40%)

20以上:100分

15-20:80分

10-15:60分

10以下:30分

女同胞

体重指数(体重(kg)/身高(m)2):(25%)

17-23: 100分

23-28:80分

小于17:70分

28以上:60分

肺活量:(35%)

小于2000:30分

2000-3000:60分

3000-3500:80分

3500以上:100分

仰卧起坐:(40%)

60以上:100分

50-60:80分

25-50:60分

25以下:30分

  • 写回答

1条回答 默认 最新

  • Russellnieh 2020-06-09 20:33
    关注

    这是我用xcode写的,还请多指教

    #include "stdio.h"
    int Male_test(int wei,int hei,int pul,int up)
    {
        int ratio;
        int s1,s2,s3,s4;
        ratio=wei/hei;
        if (ratio>=17||ratio<23) s1=25;
        if (ratio>=23||ratio<=28) s1=20;
        if (ratio<17) s1=17.5;
        if (ratio>28) s1=15;
        if (pul<3000) s2=10.5;
        if (pul>=3000||pul<4000) s2=21;
        if (pul>=4000||pul<=4800) s2=27;
        if (pul>4800) s2=35;
        if (up>20) s3=40;
        if (up<10) s3=12;
        if (up>=10||up<15) s3=24;
        if (up>=15||up<=20) s3=32;
        s4=s1+s2+s3;
        return s4;
    }
    int Female_test(int wei,int hei,int pul,int up)
    {
        int ratio;
        int s1,s2,s3,s4;
        ratio=wei/hei;
        if (ratio>=17||ratio<23) s1=25;
        if (ratio>=23||ratio<=28) s1=20;
        if (ratio<17) s1=17.5;
        if (ratio>28) s1=15;
        if (pul<2000) s2=10.5;
        if (pul>=2000||pul<3000) s2=21;
        if (pul>=3000||pul<=3500) s2=27;
        if (pul>3500) s2=35;
        if (up>60) s3=40;
        if (up<25) s3=12;
        if (up>=25||up<50) s3=24;
        if (up>=50||up<=60) s3=32;
        s4=s1+s2+s3;
        return s4;
    }
    
    int main()
    {
        int height,weight;
        int pulmonary;
        int pull_up,sit_up,result;
        int gender;
        printf("Please choose your gender:\n[1]Male\n[2]Female\n");
        scanf("%d",&gender);
        switch (gender) {
            case 1:
                printf("Please the male's weight,height,pulmonary and pull_up\n");
                scanf("%d%d%d%d",&weight,&height,&pulmonary,&pull_up);
                result=Male_test(weight, height, pulmonary, pull_up);
                if (result<60) printf("Unhealth\n");
                if (result>80) printf("Health\n");
                else printf("Common\n");
                break;
    
            case 2:
                printf("Please the female's weight,height,pulmonary and sit_up\n");
                scanf("%d%d%d%d",&weight,&height,&pulmonary,&sit_up);
                result=Male_test(weight, height, pulmonary, sit_up);
                if (result<60) printf("Unhealth\n");
                if (result>80) printf("Health\n");
                else printf("Common\n");
                break;
        }
    
        return 0;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器