您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > C语言大作业(成绩管理系统)
C语言大作业(成绩管理系统)制作人:皇家战盾2016年12月31日;流程图:开始菜单显示ndenglu()zhuce()菜单选择y=a[i]chenggongxuehaoxuehao=stu[i]student()teacher()chengji()gerenchengji()gerengaofen()xtianjia()xiugai()shanchu()quanbanchengjishuchu()xiugai()Paixu()chaxun()xuehaoxuehaookxuehaochenggonglianxilaoshi结束信息结构体中包括:学号、姓名、英语成绩、高数成绩、大物成绩、C语言成绩、机械制图成绩、政治成绩、体育成绩、总成绩、平均分。源程序代码#includestdio.h#includestdlib.hstructstudent{intnum;学号charname[100];姓名intscore1;英语intscore2;高数intscore3;大物intscore4;C语言intscore5;机械制图intscore6;政治intscore7;体育intscore8;总成绩intscore9;平均分}stu[100];intR;intxuehao;doubleping[10];intgao[10];voiddenglu();登录函数voidstudent();学生登录界面函数voidteacher();教师登录界面函数voidchengji();voidquanbanchengjishuchu();调用全班各科成绩、总分、平均分进行输出函数voidtianjia();教师使用添加学生成绩函数voidxiugai();教师使用修改学生成绩函数voidinput();教师修改成绩将成绩录入文档函数voidshanchu();教师删除学生信息及成绩函数voidgerenchengji();输出显示学生个人成绩voidzhuce();学生登录注册函数voidpingjun();成绩计算平均分voidchaxun();教师使用按学号查询学生个人成绩voidxuehaopaixu();按学号顺序显示个人成绩voidgerengaofen();学生使用查询各科最高分voidzuigaofen();显示各科最高分分数voidps1();英语成绩排序voidps2();高数成绩排序voidps3();大物成绩排序voidps4();C语言成绩排序voidps5();工图成绩排序voidps6();政治成绩排序voidps7();体育成绩排序voidpz();总成绩排序voidxueshengpaiming(intnumber);学生查看自己在全班排名main(){intx;system(cls);chengji();pingjun();zuigaofen();system(cls);printf(\n*****欢迎使用本成绩管理系统*****\n\n请选择功能:\n1.登录\n2.注册\n您选择的功能编号为:);scanf(%d,&x);if(x==1){denglu();}elseif(x==2){zhuce();}else{printf(请正确选择!);}}voiddenglu(){inta[100],b[100],c[100],i,y,m,n;charw;FILE*fp;fp=fopen(zhanghao.txt,r);for(i=0;i1000;i++){fscanf(fp,%d%d%d,&a[i],&b[i],&c[i]);}fclose(fp);again:system(cls);printf(\n***请输入您的用户名和密码***\n\n用户名:);scanf(%d,&y);for(i=0;i1000;i++){n=i;if(y==a[i])gotochenggong;}printf(用户名不存在,请正确输入!);gotoagain;chenggong:printf(密码:);scanf(%d,&m);{if(m==b[n])printf(登录成功!);else{printf(请正确输入!);scanf(%c,&w);scanf(%c,&w);gotoagain;}}xuehao=c[n];for(i=0;iR;i++){if(xuehao==stu[i].num)gotook;}if(xuehao==1)gotook;printf(\n此学生以被老师删除,请联系老师);printf(按回车键返回);scanf(%c,&w);scanf(%c,&w);main();ok:if(c[n]==1){teacher();}else{student();}}voidstudent(){inti,k,x;chengji();system(cls);for(i=0;i1000;i++){k=i;if(xuehao==stu[i].num)gotook;}ok:printf(\n*****欢迎使用本系统*****\n\n你好!%s同学\n\n,stu[k].name);printf(请选择功能\n1.本人成绩查询\n2.各科最高分查询\n\n*如需退出请直接关闭*\n);scanf(%d,&x);if(x==1){gerenchengji();}if(x==2){gerengaofen();}}voidteacher(){intx;system(cls);chengji();xuehaopaixu();pingjun();printf(\n*****欢迎敬爱的老师使用本系统*****\n\n);printf(请选择您需要的功能:\n1.学生管理\n2.成绩管理\n\n*如需退出请直接关闭*\n);scanf(%d,&x);if(x==1){system(cls);printf(\n*****欢迎敬爱的老师使用本系统*****\n\n请选择您需要对学生所做的操作\n1.添加某学生数据\n2.修改某学生数据\n3.删除某学生数据\n4.返回\n);scanf(%d,&x);switch(x){case1:{tianjia();}case2:{xiugai();}case3:{shanchu();}case4:{teacher();}}}elseif(x==2){system(cls);printf(\n*****欢迎敬爱的老师使用本系统*****\n\n请选择您需要对成绩所做的操作\n1.查看全班学生的考试成绩\n2.修改某学生的考试成绩\n3.查看全班学生的排名\n4.按学号查询某学生的成绩\n5.返回\n);scanf(%d,&x);switch(x){case1:{quanbanchengjishuchu();}case2:{xiugai();}case3:{printf(请选择排序方式:\n1.按总分排序\n2.按英语成绩排序\n3.按高等数学成绩排序\n4.按大学物理成绩排序\n5.按c语言成绩排序\n6.按机械制图成绩排序\n7.按政治成绩排序\n8.按体育成绩排序\n);//英语、高等数学、大学物理、C语言、机械制图、政治、体育scanf(%d,&x);switch(x){case1:{pz();quanbanchengjishuchu();}case2:{ps1();quanbanchengjishuchu();}case3:{ps2();quanbanchengjishuchu();}case4:{ps3();quanbanchengjishuchu();}case5:{ps4();quanbanchengjishuchu();}case6:{ps5();quanbanchengjishuchu();}case7:{ps6();quanbanchengjishuchu();}case8:{ps7();quanbanchengjishuchu();}}}case4:{chaxun();}case5:{teacher();}}}else;return0;}voidchengji(){inti;FILE*fp1;FILE*fp2;FILE*fp3;fp1=fopen(chengji.txt,r);fp2=fopen(name.txt,r);fp3=fopen(renshu.txt,r);fscanf(fp3,%d,&R);printf(目前本成绩管理系统所存学生人数为%d人\n,R);for(i=0;iR;i++){fscanf(fp1,%d,&stu[i].num);fscanf(fp2,%s,stu[i].name);fscanf(fp1,%d,&stu[i].score1);fscanf(fp1,%d,&stu[i].score2);fscanf(fp1,%d,&stu[i].score3);fscanf(fp1,%d,&stu[i].score4);fscanf(fp1,%d,&stu[i].score5);fscanf(fp1,%d,&stu[i].score6);fscanf(fp1,%d,&stu[i].score7);fscanf(fp1,%d,&stu[i].score8);fscanf(fp1,%d,&stu[i].score9);stu[i].score8=stu[i].score1+stu[i].score2+stu[i].score3+stu[i].score4+stu[i].score5+stu[i].score6+stu[i].score7;stu[i].score9=(stu[i].score1+stu[i].score2+stu[i].score3+stu[i].score4+stu[i].score5+stu[i].score6+stu[i].score7)/7;}fclose(fp1);fclose(fp2);fclose(fp3);}voidquanbanchengjishuchu(){inti;charw;system(cls);printf(学号\t姓名\t1.英语\t2.高数\t3.大物\t4.C语言\t5.机械制图\t6.政治\t7.体育\t总成绩\t\t平均分\n);for(i=0;iR;i++){printf(%d\t,stu[i].num);printf(%s\t,stu[i].name);printf(%d\t,stu[i].score1);printf(%d\t,stu[i].score2);printf(%d\t,stu[i].score3);printf(%d\t,stu[i].score4);printf(%d\t\t,stu[i].score5);printf(%d\t,stu[i].score6);printf(%d\t,stu[i].score7);printf(%d\t\t,stu[i].score8);printf(%d\t\n,stu[i].score9);}printf(全班平均成绩\t%.2lf\t\%.2lf\t%.2lf\t%.2lf\t%.2lf\t\t%.2lf\t%.2lf\t%.2lf\t\t%.2lf\n,ping[1],ping[2],ping[3],ping[4],ping[5],ping[6],ping[7],ping[8],ping[9]);printf(按回车键返回);scanf(%c,&w);scanf(%c,&w);teacher();}voidtianjia(){inta[10],i;charb[1][100],w;FILE*fp1;FILE*fp2;FILE*fp3;fp1=fopen(chengji.txt,a);fp2=fopen(name.txt,a);fp3=fopen(renshu.txt,w);printf(清输入这名学生的学号\n);scanf(%d,&a[0]);for(i=0;iR;i++){if(a[0]==stu[i].num){printf(以存
本文标题:C语言大作业(成绩管理系统)
链接地址:https://www.777doc.com/doc-6235970 .html