学生成绩管理系统

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

学生成绩管理系统V1.0(4分)#C,功能已实现,但是网页上的运行结果显示错误,暂时没找到问题所在题目内容:某班有最多不超过30人(具体人数由键盘输入)参加某门课程的考试,用一维数组作函数参数编程实现如下学生成绩管理:(1)录入每个学生的学号和考试成绩;(2)计算课程的总分和平均分;(3)按成绩由高到低排出名次表;(4)按学号由小到大排出成绩表;(5)按学号查询学生排名及其考试成绩;(6)按优秀(90~100)、良好(80~89)、中等(70~79)、及格(60~69)、不及格(0~59)5个类别,统计每个类别的人数以及所占的百分比;(7)输出每个学生的学号、考试成绩。程序运行结果示例:Inputstudentnumber(n30):6↙ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:1↙Inputstudent'sID,nameandscore:1100300187↙1100300598↙1100300375↙1100300248↙1100300465↙11003006100↙ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:2↙sum=473,aver=78.83ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:3↙Sortindescendingorderbyscore:1100300610011003005981100300187110030037511003004651100300248ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:4↙Sortinascendingorderbynumber:1100300187110030024811003003751100300465110030059811003006100ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:5↙Inputthenumberyouwanttosearch:110030041100300465ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:6↙60116.67%60-69116.67%70-79116.67%80-89116.67%90-99116.67%100116.67%ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:7↙1100300187110030024811003003751100300465110030059811003006100ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:8↙Inputerror!ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:0↙Endofprogram!输入格式:(1)录入学生的人数:**输入数据格式:%d**提示信息:Inputstudentnumber(n30):\n(2)录入每个学生的学号和考试成绩:**输入数据格式:%ld%f**提示信息:Inputstudent'sID,nameandscore:\n输出格式:菜单项的输出显示:ManagementforStudents'scores1.Inputrecord2.Caculatetotalandaveragescoreofcourse3.Sortindescendingorderbyscore4.Sortinascendingorderbynumber5.Searchbynumber6.Statisticanalysis7.Listrecord0.ExitPleaseInputyourchoice:计算课程的总分和平均分:**输出总分与平均分格式:sum=%.0f,aver=%.2f\n按成绩由高到低排出名次表:**输出格式:%ld\t%.0f\n**提示信息:Sortindescendingorderbyscore:\n按学号由小到大排出成绩表:**输出格式:%ld\t%.0f\n**提示信息:Sortinascendingorderbynumber:\n按学号查询学生排名及其考试成绩:**如果未查到此学号的学生,提示信息:Notfound!\n**如果查询到该学生,输出格式:%ld\t%.0f\n按优秀(90~100)、良好(80~89)、中等(70~79)、及格(60~69)、不及格(0~59)5个类别,统计每个类别的人数以及所占的百分比:**成绩60输出格式:60\t%d\t%.2f%%\n**成绩=100输出格式:%d\t%d\t%.2f%%\n**其他输出百分比格式:%d-%d\t%d\t%.2f%%\n为避免出现格式错误,请直接拷贝粘贴题目中给的格式字符串和提示信息到你的程序中。#源代码#includestdio.h#includemath.h#includestring.h#defineN30voidinput(longhao[N],floatrecord[N],intn);1.录入voidcalcu(floatrecord[N],floatcal[2],intn);2.计算总分与平均分voidsort_score(longhao[N],floatrecord[N],intn);3.按成绩排名voidsort_num(longhao[N],floatrecord[N],intn);4/7.按学号排名voidsearch(longhao[N],floatrecord[N],intn);5.按学号查询voidanaly(floatrecord[N],intn);6.按类别统计voidmenu();菜单voidanaly(floatrecord[N],intn){inti,num[6]={0};floatper[6]={0};for(i=0;in;i++){if(record[i]==100)num[0]++;elseif(record[i]=90)num[1]++;elseif(record[i]=80)num[2]++;elseif(record[i]=70)num[3]++;elseif(record[i]=60)num[4]++;elsenum[5]++;}for(i=0;i6;i++){per[i]=(float)num[i]/n*100;}printf(60\t%d\t%.2f%%\n,num[5],per[5]);printf(%d-%d\t%d\t%.2f%%\n,60,69,num[4],per[4]);printf(%d-%d\t%d\t%.2f%%\n,70,79,num[3],per[3]);printf(%d-%d\t%d\t%.2f%%\n,80,89,num[2],per[2]);printf(%d-%d\t%d\t%.2f%%\n,90,99,num[1],per[1]);printf(%d\t%d\t%.2f%%\n,100,num[0],per[0]);}voidsearch(longhao[N],floatrecord[N],intn){inti;longsear;printf(Inputthenumberyouwanttosearch:\n);getchar();scanf(%ld,&sear);for(i=0;in;i++){if(hao[i]==sear){printf(%ld\t%.0f\n,hao[i],record[i]);break;}}if(i==n){printf(Notfound!\n);}}voidsort_num(longhao[N],floatrecord[N],intn){intcount,i;printf(Sortinascendingorderbynumber:\n);for(count=1;count=n;count++){for(i=0;in;i++){if((int)hao[i]%10==count){printf(%ld\t%.0f\n,hao[i],record[i]);break;}}}}voidsort_score(longhao[N],floatr

1 / 10
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功