学生综合测评系统

上传人:m**** 文档编号:154885643 上传时间:2022-09-22 格式:DOCX 页数:16 大小:32.13KB
收藏 版权申诉 举报 下载
学生综合测评系统_第1页
第1页 / 共16页
学生综合测评系统_第2页
第2页 / 共16页
学生综合测评系统_第3页
第3页 / 共16页
资源描述:

《学生综合测评系统》由会员分享,可在线阅读,更多相关《学生综合测评系统(16页珍藏版)》请在装配图网上搜索。

1、#include#includestdlib.h#includestring.h#includestructstudent*Read();voidsave(structstudent*head);voidsinput(structstudent*p);structstudent*input();voidpaixu_num(structstudent*head);structstudent*insert();structstudent*alter();structstudent*del();voidfind_num(structstudent*phead);voidfind_name(struc

2、tstudent*phead);voidoutput();voidmin_student(structstudent*phead);voidmax_student(structstudent*phead);voidave_student(structstudent*phead);voidevery_student(structstudent*phead);voidscore_paixu(structstudent*head);voidhelp();voidtj_menu(structstudent*head);voidfind_menu(structstudent*head);voidmenu

3、();structstudent/定义学生信息结构数组,用于学生信息输入charnumber13;charname13;charsex4;charadds15;charphone14;charqq14;floatchinese,math,english,txhp,pinde,teacher;intzcmc,ksmc;doubleave,zc;structstudent*next;#defineLensizeof(structstudent)intlen;/链表长度inta=0,b=0,c=0,d=0,e=0;/用来存放成绩各阶的人数,返回指向此链表头指针charstu10;structstud

4、ent*Read()/读取数据文件保存到链表中structstudent*head=NULL;structstudent*p1,*p2;FILE*fp;cout请输入你要打开的文件(.dat)stu;if(fp=fopen(stu,rb+)=NULL)cout打开文件出错!endl;exit(0);while(!feof(fp)if(p1=(structstudent*)malloc(Len)=NULL)cout内存申请出错next=p1;p2=p1;fclose(fp);returnhead;voidsave(structstudent*head)/数据存盘FILE*fp;structstu

5、dent*p;p=head;cout请输入你要存进去的文件(.dat)stu;if(fp=fopen(stu,wb)=NULL)cout无法打开文件!endl;system(pause);menu();while(p)if(fwrite(p,Len,1,fp)!=1)cout写入数据出错next;!endl;cout数据存入成功!请按任意键继续getchar();fclose(fp);/单次输入voidsinput(structstudent*p)cout请输入学号:p-number;cout请输入姓名:p-name;cout请输入性别:p-sex;cout请输入家庭住址:p-adds;cou

6、t请输入联系电话:p-phone;cout请输入qq:p-qq;cout请输入语文成绩:p-chinese;if(p-chinese100|p-chinese0)p-chinese;p-math;cout成绩输入不符合规定,请重新输入:cout请输入数学成绩:p-math;if(p-math100|p-math0)cout成绩输入不符合规定,请重新输入:cout请输入英语成绩:p-english;if(p-english100|p-english0)cout成绩输入不符合规定,请重新输入:cout请输入同学互评分:p-txhp;if(p-txhp100|p-txhp0)cout成绩输入不符合规

7、定,请重新输入:cout请输入品德成绩:p-pinde;if(p-pinde100|p-pinde0)cout成绩输入不符合规定,请重新输入:p-english;p-txhp;p-pinde;cout请输入任课教师评分:p-teacher;if(p-teacher100|p-teacher0)cout成绩输入不符合规定,请重新输入:p-teacher;p-ave=(p-chinese+p-math+p-english)/3.0;p-zc=(p-ave*0.6+p-txhp*0.1+p-pinde*0.2+p-teacher*0.1);coutendl;ndl;coutvvcout你刚输入的信息

8、为:numbervvendl;coutvvtt姓名:vvp-namevvendl;coutvvtt性别:vvp-sexvvendl;coutvvtt家庭住址:vvp-addsvvendl;coutvvtt联系电话:vvp-phonevvendl;coutvvttQQ号:vvp-qqvvendl;coutvvtt语文成绩:vvp-chinesevvendl;coutvvtt数学成绩:vvp-mathvvendl;coutvvtt英语成绩:vvp-englishvvendl;coutvvtt品德成绩:vvp-pindevvendl;coutvvtt教师评分:vvp-teachervvendl;co

9、utvv*:ndl;return;/学生成绩录入函数structstudent*input()structstudent*head=NULL,*p1,*p2;/输入p1,p2链表最后节点charch=y;len=1;p2=p1=(structstudent*)malloc(sizeof(structstudent);coutvv请输入第vvlenvv个学生的信息:vvendl;sinput(p1);coutvvendl;coutvv按n退出或按任意键继续vvendl;cinch;while(1)if(len=1)/作为头结点head=p1;elsep2-next=p1;p2=p1;if(ch=

10、N|ch=n)break;p1=(structstudent*)malloc(sizeof(structstudent);system(cls);len+;cout请输入第len个学生的信息:endl;sinput(p1);coutendl;cout按n退出或按任意键继续ch;p2-next=NULL;paixu_num(head);cout输入学生信息完成!请按任意键返回主菜单!endl;getchar();returnhead;/学号排序voidpaixu_num(structstudent*head)structstudentt,*r,*p,*q;/t交换p、q,r头结点r=head;i

11、f(r=NULL)cout学生信息不存在,请先输入学生信息!next;while(q)if(strcmp(q-number,p-number)0)/qnumber);strcpy(t.name,q-name);strcpy(t.sex,q-sex);strcpy(t.adds,q-adds);strcpy(t.phone,q-phone);strcpy(t.qq,q-qq);t.chinese=q-chinese;t.math=q-math;t.english=q-english;t.txhp=q-txhp;t.pinde=q-pinde;t.teacher=q-teacher;strcpy(

12、q-number,p-number);strcpy(q-name,p-name);strcpy(q-sex,p-sex);strcpy(q-adds,p-adds);strcpy(q-phone,p-phone);strcpy(q-qq,p-qq);q-chinese=p-chinese;q-math=p-math;q-english=p-english;q-txhp=p-txhp;q-pinde=p-pinde;q-teacher=p-teacher;strcpy(p-number,t.number);strcpy(p-name,t.name);strcpy(p-sex,t.sex);str

13、cpy(p-adds,t.adds);strcpy(p-phone,t.phone);strcpy(p-qq,t.qq);p-chinese=t.chinese;p-math=t.math;p-english=t.english;p-txhp=t.txhp;p-pinde=t.pinde;p-teacher=t.teacher;q=q-next;r=r-next;/插入函数structstudent*insert()structstudent*p,*p1,*head;head=Read();p1=head;p=(structstudent*)malloc(sizeof(structstuden

14、t);charnum14,ch;cout请输入你要插入的前一个学生的学号:num;while(p1)if(!strcmp(p1-number,num)sinput(p);p-next=p1-next;p1-next=p;len+;elsep1=p1-next;cout按n退出或按任意键继续ch;if(ch=N|ch=n)break;cout学生信息插入成功!请按任意键返回!endl;getchar();returnhead;/修改学生信息structstudent*alter()chartemp13;structstudent*p,*head;head=Read();p=head;coutte

15、mp;while(p)if(!strcmp(p-number,temp)sinput(p);p=p-next;coutendl;cout学生信息修改成功!请按任意键返回!endl;coutendl;system(pause);returnhead;/删除学生信息structstudent*del()chartemp13;intm=0;structstudent*p1,*p,*head;/p1删除head=Read();p1=p=head;cout请输入你要删除学生的学号:temp;while(p)if(strcmp(p1-number,temp)=0)if(p1=head)/删除的头结点hea

16、d=p1-next;elsep-next=p1-next;len-;m=1;endl;coutnext;if(!m)cout查找不到这个信息!endl;returnhead;voidfind_num(structstudent*head)/按学号查找structstudent*p=head;chartemp9;intm=0;cout请输入要查找的学生的学号temp;while(p!=NULL)if(strcmp(p-number,temp)=0)coutvv该学生的具体信息为:vvendl;coutvvendl;coutvv?dl;coutvvttcoutvvttcoutvvttcoutvvt

17、t学号:numberendl;姓名:nameendl;性别:sexendl;家庭住coutvvttif(!m)址:addsendl;联系电话:phoneqqvvendl;!chinesevvenmathvvendl;成绩英语IIvvp-englishvvendl;成绩平均IIvvp-avevvendl;成绩品德IIvvp-pindevvendl;成绩老师IIvvp-teachervvendl;评分综合IIvvp-zcvvendl;score_paixu(head);coutvvtt考试名次IIksmcendl;coutvvtt综测名次IIzcmcendl;coutvvnext;/继续向下寻找c

18、outname,temp)=0)按姓名查找vvendl;cintemp;coutvv该学生的具体信息为:vvendl;coutvvendl;coutvvendl;coutvv学号:vvp-numbervvendl;coutvvttcoutv姓名:vvp-namevvend|;coutvvttcoutvV性别:vvp-sexvvendl;coutvvttQQco家I庭住址:vvp-addsvvendl;绩话:vvp-phonevvendl;号vvp-qqvvendl;数学成绩coutvvtt语文成口vvp-chinesevvendl;vvp-mathvvendl;vvp-englishvvend

19、l;vvp-avevvendl;vvp-pindevvendl;vvp-teachervvendl;coutvvttcoutvvttcoutvvttcoutvvttcoutvvtt英语成绩平均成绩品德成绩老师评分综合成绩score_paixu(head);vvp-zcvvendl;vvp-ksmcvvendl;vvp-zcmcvvendl;coutvvtt考试名次coutvvtt综测名次coutvv=dl;coutnext;if(!m)coutvv查找不到这个学号的信息!vvendl;coutvv按任意键返回主菜单.vvendl;getchar();return;voidoutput()str

20、uctstudent*p,*head;head=Read();p=head;inti=1;while(p)coutvvendl;coutvvtt学号:vvp-numbervvendl;coutvvtt姓名:vvp-namevvendl;coutvvtt性别:vvp-sexvvendl;coutvvtt家庭住址:vvp-addsvvendl;?dl;phonevvendl;coutvvttQQ号:vvp-qqvvendl;coutvvtt语文成绩:vvp-chinesevvendl;coutvvtt数学成绩:vvp-mathvvendl;coutvvtt英语成绩:vvp-englishvvend

21、l;coutvvtt品德成绩:vvp-pindevvendl;coutvvtt老师评分:vvp-teachervvendl;coutvvtt平均成绩:vvp-avevvendl;coutvvtt综合成绩:vvp-zcvvendl;score_paixu(head);coutvvtt考试名次vvp-ksmcvvendl;coutvvtt综合测评名次vvp-zcmcvvendl;p=p-next;i+;coutvvcoutvvendl;coutvv请按任意键返回主菜单.vvendl;getchar();return;voidmax_student(structstudent*head)struct

22、student*p=head;floatc2=0,m2=0,e2=0,s2=0,p2=0,stu2=0,t2=0;doublea2=0,zc2=0;while(p)if(p-chinesec2)c2=p-chinese;if(p-mathm2)m2=p-math;if(p-englishe2)e2=p-english;if(p-chinese+p-math+p-english)s2)s2=(p-chinese+p-math+p-english);if(p-pindep2)p2=p-pinde;if(p-txhpstu2)stu2=p-txhp;if(p-teachert2)t2=p-teach

23、er;if(p-avea2)a2=p-ave;if(p-zczc2)zc2=p-zc;p=p-next;coutvvcouttt语文最高分:c2chinesevc1)c1=p-chinese;if(p-mathvm1)m1=p-math;if(p-englishve1)e1=p-english;if(p-chinese+p-math+p-english)vs1)s1=(p-chinese+p-math+p-english);if(p-pindevp1)p1=p-pinde;if(p-txhpvstu1)stu1=p-txhp;if(p-teacherteacher;if(p-aveave;if

24、(p-zczc;p=p-next;coutvv?dl;couttt语文最低分:c1chinese;m_sum+=p-math;e_sum+=p-english;p_sum+=p-pinde;stu_sum+=p-txhp;t_sum+=p-teacher;zc_sum+=p-zc;p=p-next;c_ave=c_sum/len;m_ave=m_sum/len;e_ave=e_sum/len;all_ave=(c_ave+m_ave+e_ave)/3;p_ave=p_sum/len;stu_ave=stu_sum/len;t_ave=t_sum/len;enzc_ave=zc_sum/len;

25、coutttcoutttcoutttcoutttcoutttcoutttcoutttcoutttcoutttcoutttcoutendl;dl;语文c_aveendl;平均分m_aveendl;为数学平均分为英语e_aveendl;all_aveendl;p_aveendl;平均分为总成绩平均为品德平均分为同学互评平均分为:stu_aveendl;教师评分平均分为:t_aveendl;综测平均分为:zc_aveendl;endlcout请按任意键返回.ave/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;brea

26、k;default:e+;p=p-next;coutvv=dl;cout平均成绩在90分以上的有:aendl;coutvv平均成绩在80分以上的有:vvbvvendl;coutvv平均成绩在70分以上的有:vvcvvendl;cout平均成绩在60分以上的有:dendl;cout平均成绩在60分以下的有:echinese/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;break;default:e+;p=p-next;math/10)case10:case9:a+;break;case8:b+;break;cas

27、e7:c+;break;case6:d+;break;default:e+;p=p-next;coutvvcoutvv数学成绩在coutvv数学成绩在coutvv数学成绩在coutvv数学成绩在coutvv数学成绩在90分以上的有:80分以上的有:70分以上的有:60分以上的有:60分以下的有:vvavvendl;vvbvvendl;vvcvvendl;vvdvvendl;vvevvendl;dl;while(p)switch(int)p-english/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;break;

28、default:e+;p=p-next;cout英语成绩在coutvv英语成绩在coutvv英语成绩在coutvv英语成绩在while(p)coutvv?dl;90分以上的有:aendl;80分以上的有:bendl;70分以上的有:cendl;cOAv分1以上的有绩在vvdvvendl;60分以下的有:epinde/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;break;default:e+;p=p-next;coutvvendl;coutvv品德成绩在90分以上的有:vvavvendl;coutvv品德成绩在

29、80分以上的有:vvbvvendl;coutvv品德成绩在70分以上的有:vvcvvendl;coutvv品德成绩在60分以上的有:vvdvvendl;coutvv品德成绩在while分以下的有:vvevvendl;switch(int)p-txhp/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;break;default:e+;p=p-next;coutvvteacher/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;break;

30、default:e+;p=p-next;coutvvcoutvv教师评分在coutvv教师评分在while(p)dl;c(90tv分以上1的有分在cOO以上师评有:在70分以上的有:60分以上的有:60分以下的有:vvaVvend教师评分在vvbvvendl;vvcvvendl;vvdvvendl;vvevvendl;switch(int)p-zc/10)case10:case9:a+;break;case8:b+;break;case7:c+;break;case6:d+;break;default:e+;p=p-next;endl;coutvvcout综测成绩在90分以上的有:cout综测

31、成绩在80分以上的有:cout综测成绩在70分以上的有:aendl;bendl;cendl;cout综测成绩在60分以上的有:dendl;cout综测成绩在60分以下的有:eendl;coutvv?dl;cout请按任意键退出.next;double*ave1=newdoublen;double*zc1=newdoublen;for(inti=0;ivn;i+)/依次存入每一个学生ave,zcave1i=p1-ave;zc1i=p1-zc;p1=p1-next;for(i=0;ivn;i+)/冒泡排序for(intj=0;jvn;j+)if(ave1jvave1j+1)doubleave11=

32、ave1j;ave1j=ave1j+1;ave1j+1=ave11;if(zc1jvzc1j+1)doublezc11=zc1j;zc1j=zc1j+1;zc1j+1=zc11;while(r)for(i=0;iave)r-ksmc=i+1;if(zc1i=r-zc)r-zcmc=i+1;r=r-next;则按cout排名完成!请按任意键返回主菜单的浏览学生信息查看!(如果是浏览学生信息任意键得到名次!)endl;deleteave1;deletezc1;getchar();return;/帮助voidhelp()system(cls);/清屏cout*欢迎使用学生综合测评系统*endl;co

33、utendl;cout本系统可以存储学生的基本信息和数据信息,所有信息按学号以小到大的顺序存入文件。endl;cout基本信息包括:学号、姓名、性别、家庭住址、联系电话、qqendl;cout数据信息包括:语文、数学、外语三门单科成绩、考试平均成绩、考试名次、同学互评分、品德成绩、任课教师评分、综合测评分、综合测评名次endl;coutvv综合测评分=(考试平均成绩)*0.6+(同学互评分)*0.1+品德成绩*0.1+任课老师评分*0.2。endl;coutvv考试成绩=(语文+数学+外语)/3endl;coutendl;coutvv该菜单分为三个菜单,一个主菜单,两个子菜单。vvendl;c

34、outvv主菜单提供基本信息操作,子菜单分别提供学生信息查找功能、学生数据统计功能。vvendl;coutendl;coutvv希望帮助对您有用-endl;coutc;system(cls);switch(c)case0:menu();break;case1:max_student(head);break;case2:min_student(head);break;case3:ave_student(head);break;case4:every_student(head);break;case5:score_paixu(head);break;default:coutvv输入有误!请重新输入

35、:vvendl;break;voidfind_menu(structstudent*head)intc;for(;)system(cls);coutvvendl;coutvttt*vc;system(cls);switch(c)case0:menu();break;case1:find_num(head);break;case2:find_name(head);break;default:cout输入有误!请重新输入:endl;break;voidintc;menu()主菜单structstudent*head;for(;)vvendl;system(cls);coutc;system(cls

36、);if(c=0)cout你即将退出系统!谢谢使用!endl;exit(0);switch(c)case1:head=input();break;case2:head=insert();paixu_num(head);break;case3:head=alter();break;case4:head=del();break;case5:output();break;case6:head=Read();find_menu(head);break;case7:head=Read();tj_menu(head);break;case8:save(head);break;case9:help();break;default:cout输入有误!请重新输入:endl;break;intmain(void)system(color3e);voidmenu();coutendl;coutendl;endl;coutt欢迎使用学生综合管理系统coutendl;system(pause);menu();return0;

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!