学生成绩管理系统C语言代码.doc_第1页
学生成绩管理系统C语言代码.doc_第2页
学生成绩管理系统C语言代码.doc_第3页
学生成绩管理系统C语言代码.doc_第4页
学生成绩管理系统C语言代码.doc_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

“学生学习成绩管理系统”用于对学生学习成绩数据文件的新文件创建和老文件管理,并可以进行密码设置。具体要求实现的功能如下:1、输入添加记录:将每一个学生的学号、姓名和各科学习成绩作为一个记录进行输入或添加。要求经过密码验证后能建立一个新的数据文件或给已建立好的数据文件增加记录。2、显示、查询记录:能按学生姓名(或学号)显示、查询一个或多个学生的各门(或某门)功课的成绩和平均成绩。3、修改记录:可以对数据文件中的任意记录的数据进行修改,在修改前后对该记录的内容进行显示,并设确认提示。(要求设置密码,验证通过后方可进入修改环节)4、删除记录:可以删除数据文件中的任一记录,包括逻辑删除(具有恢复功能)和物理删除(不可恢复)。(说明:该功能也应设置为经过验证密码后才可实施删除)5、成绩排序:采用不同的排序方法对单科成绩和总(或平均)成绩进行排序,但不能改变原记录的顺序。6、统计功能:(A)计算各门课程全班总成绩及平均成绩;(B)统计各门课程得分为100、9099、8089、7079、6069和不及格学生的人数,以及与全班总人数的百分比。7、其他:该软件应具有系统名称、设计单位或个人等基本信息。学生成绩管理系统源程序清单:#include#include#include#include#defineNULL0#defineLENsizeof(student)#defineN5typedefstructstuintflag;longnum;charname10;intscoreN;structstu*next;student;voidedit();/*编辑菜单*/voidsearch(student*head);/*查找函数*/student*search_number(student*head,longnumber);/*按学号查找*/voidsearch_name(student*head);/*按姓名查找*/student*search_score(student*head,intmin,intmax,inti);/*按成绩查找*/voidenter_record(student*p);/*输入成绩*/student*creat(void);/*建立链表*/student*insert(student*head);/*插入结点*/voidcount(int*p);/*计算总成绩及平均成绩*/voidprint(student*p);/*输出结点*/voidprint_title();/*输出标题*/student*delete(student*head);/*删除结点*/voidrecover(student*head);/*恢复删除*/voidrevise(student*head);/*修改记录*/voidtongji(student*head);/*统计*/voidpaixu(student*head,intm);/*排序*/intcipher_check();/*密码检测*/voidset_up_cipher();/*设立密码*/student*load();/*载入*/voidsave(student*head);/*保存*/voidabout();/*关于*/intn;charcipher11=;/*字符串,保存密码*/main()charc;student*head=NULL;system(cls);about();for(;)system(cls);printf(*n);printf(ttWelcometon);printf(nttThestudentscoremanagesystemn);printf(*MENU*n);printf(ttt1.Creattherecordn);printf(ttt2.Loadthefilen);printf(ttt3.Edittherecordn);printf(ttt4.Aboutdesignn);printf(ttt5.Quitn);printf(*n);printf(ntttEnteryourchoice(15):);for(;)c=getchar();if(c=n)continue;elseif(c5)printf(tttEnteryourchoice(15):);elsebreak;getchar();switch(c)case1:head=creat();if(head=NULL)printf(Emptyrecord!nnEnteranykeytocontinue.n);getch();break;set_up_cipher();printf(Enteranykeytoeditmenu.);getch();edit(head);break;case2:head=load();if(head=NULL)printf(nEnteranykeytocontinue.);getch();break;printf(Enteranykeytoeditmenu.);getch();edit(head);break;case3:edit(head);break;case4:about();break;case5:exit(0);voidedit(student*head)/*编辑菜单*/charc,m;inti,f=0;for(;)system(cls);printf(*EDIT*MENU*n);printf(ttt1.Savetherecord.n);printf(ttt2.Insertarecord.n);printf(ttt3.Deletearecord.n);printf(ttt4.Recovertherecord.n);printf(ttt5.Revisetherecord.n);printf(ttt6.Searchrecords.n);printf(ttt7.Sorttherecords.n);printf(ttt8.Tongjitherecords.n);printf(ttt9.Changethepassword.n);printf(ttt0.Returntomainmenu.n);printf(*n);printf(tttEnteryourchoice(09):);for(;)c=getchar();if(c=n)continue;elseif(c9)printf(tttEnteryourchoice(09):);elsebreak;switch(c)case1:save(head);f=0;break;case2:printf(Pleaseentertherightpassword:n);if(cipher_check()=0)printf(Wrongpassword!n);break;head=insert(head);f=1;break;case3:printf(Pleaseentertherightpassword:n);if(cipher_check()=0)printf(Wrongpassword!n);break;head=delete(head);f=1;break;case4:printf(Pleaseentertherightpassword:n);if(cipher_check()=0)printf(Wrongpassword!n);break;recover(head);f=1;break;case5:printf(Pleaseentertherightpassword:n);if(cipher_check()=0)printf(Wrongpassword!n);break;revise(head);f=1;break;case6:search(head);break;case7:printf(Sortonwhichsubject?n);printf(score1(1)/score2(2)/score3(3)/sum(4)n);for(;)scanf(%c,&m);if(m=n);elseif(m=1&mnum);head=NULL;while(p1-num!=0)n+;enter_record(p1);if(n=1)head=p1;elsep2-next=p1;p2=p1;p1=(student*)malloc(LEN);printf(Pleaseenternextnumber(0toend):n);scanf(%ld,&p1-num);if(n!=0)p2-next=NULL;free(p1);returnhead;student*insert(student*head)/*插入结点*/student*p1,*p2,*new_node;for(;)new_node=(student*)malloc(LEN);if(new_node=NULL)printf(Databaseisfull,cantaddmorerecord.n);returnNULL;printf(nPleaseenterthenumberyouwanttoinsertn(enter0toend):);scanf(%ld,&new_node-num);if(new_node-num=0)break;for(p1=head,p2=NULL;p1!=NULL&(new_node-num)(p1-num);p2=p1,p1=p1-next);if(p1!=NULL&(p1-num)=(new_node-num)&p1-flag=1)charc;printf(Thisnumberalreadyexists:n);print_title();print(p1);printf(Coverornot?(y/n)?);for(;)c=getchar();if(c=n|c=N)free(new_node);break;elseif(c=y|c=Y)free(new_node);enter_record(p1);break;elseif(c!=n)printf(Error!enteragain:);elsecontinue;elseif(p1!=NULL&(p1-num)=(new_node-num)n+;free(new_node);enter_record(p1);elsen+;enter_record(new_node);new_node-next=p1;if(p2=NULL)head=new_node;elsep2-next=new_node;returnhead;student*delete(student*head)/*删除结点*/longnumber;charc;student*p1,*p2;for(;)printf(Pleaseenterthenumberyouwanttodelete(enter0toend):n);scanf(%ld,&number);if(!number)break;for(p1=head,p2=NULL;p1!=NULL&p1-num!=number;p2=p1,p1=p1-next);if(p1=NULL|p1-flag=0)printf(thisnumberdoesntexist.n);elseprint_title();print(p1);printf(deletethisrecord?n);printf(sure(s)/cancle(c)/deletethoroughly(t)n);for(;)c=getchar();if(c=c|c=C)break;elseif(c=s|c=S|c=t|c=T)n-;if(c=s|c=S)p1-flag=0;elseif(p2=NULL)head=p1-next;elsep2-next=p1-next;free(p1);break;elseif(c!=n)printf(error!enteragain:);returnhead;voidrecover(student*head)/*恢复删除*/student*p;longnumber;printf(recoverwhichnumber?n);scanf(%ld,&number);if(number=0)return;p=search_number(head,number);if(p=NULL)printf(Cantrecoverthisnumber!n);elseif(p-flag=1)printf(Thisnumberhasnotbeendeleted.n);elsen+;p-flag=1;printf(Recoversuccess!n);voidrevise(student*head)/*修改记录*/charc;longnumber;student*p1;for(;)printf(Whichnumberdoyouwanttorevise?n(enter0toend):);scanf(%ld,&number);if(number=0)return;p1=search_number(head,number);if(p1=NULL|p1-flag=0)printf(thisnumberdoesntexist.n);continue;print_title();print(p1);printf(Doyouwanttorevisetherecord?(y/n)n);for(;)c=getchar();if(c=n)continue;elseif(c=n|c=N)break;elseif(c=y|c=Y)printf(pleaseenternewrecord:n);enter_record

温馨提示

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

评论

0/150

提交评论