欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    c++大作业学生信息管理系统源代码.pdf

    • 资源ID:73681459       资源大小:365.24KB        全文页数:15页
    • 资源格式: PDF        下载积分:11.9金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要11.9金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    c++大作业学生信息管理系统源代码.pdf

    学生信息管理系统源代码:#include#include#include#include#include#includestruct studentchar num30;int maths;char name30;int chinese;char clas30;int english;int total;float average;student*next;/1(1)void createlist(student*&head)/学生成绩文件导入功能(用链表储存)char t80,num030,name030,clas030;int chinese0,maths0,english0;student*s,*p;ifstream instuf(student-score.txt,ios:in);if(!instuf)cerrfile could not be open.num0name0clas0chinese0maths0english0)s=new student;strcpy(s-num,num0);strcpy(s-name,name0);strcpy(s-clas,clas0);s-chinese=chinese0;s-maths=maths0;s-english=english0;s-total=s-chinese+s-maths+s-english;s-average=float(s-total)/3;if(head=NULL)head=s;else p-next=s;p=s;p-next=NULL;instuf.close();/1(2)void showlist(student*head)/学生成绩信息显示功能(遍历链表)int n=1;cout学号姓名班级语文数学英语总分while(head)均分序号;coutnumnametclast chinesetmathstenglishttotaltsetprecision(3)averaget nnext;/2void charu(student*head)/学生成绩信息插入功能(链表尾部插入学生成绩信息)student*s,*p,*q;int n,i;coutn;cout请输入需插入的学生成绩信息(每人一行):endl;cout学号姓名班级语文数学英语next;for(i=1;is-nums-names-class-chineses-mathss-english;s-total=s-chinese+s-maths+s-english;s-average=float(s-total)/3;q-next=s;q=s;q-next=NULL;/3void shanchu(student*&head)/学生成绩信息删除功能student*p,*q;char a30;int n,i,b=1;coutn;cout请输入需要删除的学生的学号或姓名:endl;for(i=1;ia;if(strcmp(head-num,a)=0)|(strcmp(head-name,a)=0)b=0;p=head;head=head-next;delete p;p=NULL;elsep=head;while(p-next!=NULL)&(strcmp(p-next-num,a)!=0)&(strcmp(p-next-name,a)!=0)p=p-next;if(p-next!=NULL)b=0;q=p-next;p-next=q-next;delete q;q=NULL;if(b=1)cout无此学号或姓名的成绩记录!endl;/4void change(student*head)/学生成绩信息的修改功能(修改指定学生信息)char a30;int b=1;couta;while(head)if(strcmp(head-num,a)=0)|(strcmp(head-name,a)=0)coutendl;b=0;cout此学生原来的学生成绩信息是:endl;cout学号姓名班级语文数学英语endl;coutnumnametclast chinesetmathstenglishendl;cout请输入修改后的学生成绩信息:endl;cout学号姓名班级语文数学英语head-numhead-namehead-clashead-chinesehead-mathshead-english;head-total=head-chinese+head-maths+head-english;head-average=float(head-total)/3;head=head-next;if(b=1)cout无此学号或姓名的成绩记录!endl;/5(1)void geren(student*head)/查询个人成绩功能char a30;int b=1;couta;cout此学生的学生成绩信息是:endl;cout学号姓名班级语文数学英语总分均分num,a)=0)|(strcmp(head-name,a)=0)b=0;coutnumnametclast chinesenext;if(b=1)cout无此学号或姓名的成绩记录!endl;/5(2)void chabanji(student*head)/查询班级成绩功能char a30;int b=1;couta;cout此班级的学生成绩信息是:endl;cout学号姓名班级语文数学英语总分均分clas,a)=0)b=0;coutnumnametclast chinesetmathstenglishttotaltsetprecision(3)averageendl;mathstenglishttotaltsetprecision(3)averagenext;if(b=1)cout无此班级的成绩记录!endl;/5(3)void chayuwen(student*head)/查询语文成绩功能int h,l,b=1;cout请输入您要查询的【语文】成绩的分数段:endl;cout起始分终止分l;cinh;cout此分数段的学生语文成绩信息是:endl;cout学号姓名班级语文数学英语总分均分chinese=l)&(head-chinese=h)b=0;coutnumnametclast chinesenext;if(b=1)cout无此分数段的语文成绩记录!endl;/5(4)void chashuxue(student*head)/查询数学成绩功能int h,l,b=1;cout请输入您要查询的【数学】成绩的分数段:endl;cout起始分终止分l;cinh;cout此分数段的学生数学成绩信息是:endl;cout学号姓名班级语文数学英语总分均分maths=l)&(head-maths=h)b=0;coutnumnametclast chinesenext;if(b=1)cout无此分数段的数学成绩记录!endl;mathstenglishttotaltsetprecision(3)averageendl;mathstenglishttotaltsetprecision(3)averageendl;/5(5)void chayingyu(student*head)/查询英语成绩功能int h,l,b=1;cout请输入您要查询的【英语】成绩的分数段:endl;cout起始分终止分l;cinh;cout此分数段的学生英语成绩信息是:endl;cout学号姓名班级语文数学英语总分均分english=l)&(head-english=h)b=0;coutnumnametclast chinesenext;if(b=1)cout无此分数段的英语成绩记录!endl;/5(6)void chazongfen(student*head)/查询总分成绩功能int h,l,b=1;cout请输入您要查询的【总分】成绩的分数段:endl;cout起始分终止分l;cinh;cout此分数段的学生总分成绩信息是:endl;cout学号姓名班级语文数学英语总分均分total=l)&(head-total=h)b=0;coutnumnametclast chinesenext;if(b=1)cout无此分数段的总分成绩记录!endl;/6(1)void yuwen(student*head)/按语文成绩从高到低排序功能mathstenglishttotaltsetprecision(3)averageendl;mathstenglishttotaltsetprecision(3)averagenext;while(q)if(p-chinesechinese)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;c=p-average;p-average=q-average;q-average=c;q=q-next;p=p-next;/6(2)void shuxue(student*head)/按数学成绩从高到低排序功能student*p,*q;char a30;int b;float c;p=head;while(p)q=p-next;while(q)if(p-mathsmaths)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;c=p-average;p-average=q-average;q-average=c;q=q-next;p=p-next;/6(3)void yingyu(student*head)/按英语成绩从高到低排序功能student*p,*q;char a30;int b;float c;p=head;while(p)q=p-next;while(q)if(p-englishenglish)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;c=p-average;p-average=q-average;q-average=c;q=q-next;p=p-next;/6(4)void zongfen(student*head)/按总分成绩从高到低排序功能student*p,*q;char a30;int b;float c;p=head;while(p)q=p-next;while(q)if(p-totaltotal)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;q=q-next;p=p-next;/7void xuehao(student*head)/按学号从小到大排序功能student*p,*q;char a30;int b;float c;p=head;while(p)q=p-next;while(q)if(strcmp(p-num,q-num)0)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);c=p-average;p-average=q-average;q-average=c;strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;c=p-average;p-average=q-average;q-average=c;q=q-next;p=p-next;/8void xingming(student*head)/按姓名首字母排序功能student*p,*q;char a30;int b;float c;p=head;while(p)q=p-next;while(q)if(strcmp(p-name,q-name)0)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;q=q-next;p=p-next;/9void banji(student*head)/按班级的类别排序功能student*p,*q;char a30;int b;float c;p=head;c=p-average;p-average=q-average;q-average=c;while(p)q=p-next;while(q)if(strcmp(p-clas,q-clas)0)strcpy(a,p-num);strcpy(p-num,q-num);strcpy(q-num,a);strcpy(a,p-name);strcpy(p-name,q-name);strcpy(q-name,a);strcpy(a,p-clas);strcpy(p-clas,q-clas);strcpy(q-clas,a);b=p-chinese;p-chinese=q-chinese;q-chinese=b;b=p-maths;p-maths=q-maths;q-maths=b;b=p-english;p-english=q-english;q-english=b;b=p-total;p-total=q-total;q-total=b;q=q-next;p=p-next;/10void show(student*head,char*s)/学生成绩信息文件导出功能int n=1;ofstream outstuf;outstuf.open(s,ios:out);if(!outstuf)cerrfile could not be open.endl;abort();outstuf学号姓名班级语文数学英语总分均分序号endl;while(head)outstufnumnametclast chinesetmathstenglishttotaltsetprecision(3)averagetnaverage;p-average=q-average;q-average=c;n=n+1;head=head-next;outstuf.close();void main()student*head=NULL;int n;char s30;cout*;cout*欢迎使用学生成绩管理系统*;cout*管理员:*;cout*请选择您想使用的功能:*;cout*功能名请输入功能名请输入*;cout*导入学生成绩文件1按学号小到大排序7*;cout*插入学生成绩信息2按姓名首字母排序8*;cout*删除学生成绩信息3按班级的类别排序9*;cout*修改学生成绩信息4导出学生成绩文件10*;cout*查询学生成绩信息5其它功能.*;cout*按成绩高到低排序6退出管理系统0*;cout*;coutn;createlist(head);while(n0)switch(n)case 1:cout导入的需管理的学生成绩信息表:endl;showlist(head);break;case 2:charu(head);cout插入后的学生成绩信息表:endl;showlist(head);break;case 3:shanchu(head);cout删除后的学生成绩信息表:endl;showlist(head);break;case 4:change(head);cout修改后的学生成绩信息表:endl;showlist(head);break;case 5:cout请选择查询学生成绩的方式:endl;cout方式请输入方式请输入endl;cout 查询个人成绩1查询数学成绩4endl;cout 查询班级成绩2查询英语成绩5endl;cout 查询语文成绩3查询总分成绩6endl;coutn;switch(n)case 1:geren(head);break;case 2:zongfen(head);chabanji(head);break;case 3:yuwen(head);chayuwen(head);break;case 4:shuxue(head);chashuxue(head);break;case 5:yingyu(head);chayingyu(head);break;case 6:zongfen(head);chazongfen(head);break;break;case 6:cout请选择需排序的成绩的类型:endl;cout类型请输入类型cout 按语文成绩排序1按英语成绩排序cout 按数学成绩排序2按总分成绩排序coutn;switch(n)case 1:yuwen(head);cout按【语文】成绩排序后的学生成绩信息表:endl;showlist(head);break;case 2:shuxue(head);cout按【数学】成绩排序后的学生成绩信息表:endl;showlist(head);break;case 3:yingyu(head);cout按【英语】成绩排序后的学生成绩信息表:endl;showlist(head);break;case 4:zongfen(head);cout按【总分】成绩排序后的学生成绩信息表:endl;showlist(head);break;break;case 7:xuehao(head);cout按【学号】从小到大排序后的学生成绩信息表:endl;showlist(head);请输入endl;3endl;4endl;break;case 8:xingming(head);cout按【姓名】首字母排序后的学生成绩信息表:endl;showlist(head);break;case 9:banji(head);cout按【班级】的类别排序后的学生成绩信息表:endl;showlist(head);break;case 10:cout请选择需导出的学生成绩数据文件的内容:endl;cout内容请输入内容请输入;cout 按总分成绩排序的成绩表1按姓名首字母排序的成绩表3;cout 按学号大小排序的成绩表2按班级分类别排序的成绩表4;coutn;switch(n)case 1:zongfen(head);cout按【总分】成绩排序的成绩表已导出endl;cout在生成的total-sort.txt文件中endl;cout请注意查看!endl;strcpy(s,total-sort.txt);show(head,s);break;case 2:xuehao(head);cout按【学号】大小排序的成绩表已导出endl;cout在生成的number-sort.txt 文件中endl;cout请注意查看!endl;strcpy(s,number-sort.txt);show(head,s);break;case 3:xingming(head);cout按【姓名】首字母排序的成绩表已导出endl;cout在生成的name-sort.txt 文件中endl;cout请注意查看!endl;strcpy(s,name-sort.txt);show(head,s);break;case 4:banji(head);cout按【班级】分类排序的成绩表已导出endl;cout在生成的class-sort.txt文件中endl;cout请注意查看!endl;strcpy(s,class-sort.txt);show(head,s);break;break;cout 继续操作请按回车键!endl;cgets(s);coutendlendlendl;cout*;cout*欢迎使用学生成绩管理系统*;cout*管理员:*;cout*请选择您想使用的功能:*;cout*功能名请输入功能名请输入*;cout*导入学生成绩文件1按学号小到大排序7*;cout*插入学生成绩信息2按姓名首字母排序8*;cout*删除学生成绩信息3按班级的类别排序9*;cout*修改学生成绩信息4导出学生成绩文件10*;cout*查询学生成绩信息5其它功能.*;cout*按成绩高到低排序6退出管理系统0*;cout*;coutn;coutendl您所使用的功能已完成,谢谢使用!endl;cout欢迎再次使用!endlendl;

    注意事项

    本文(c++大作业学生信息管理系统源代码.pdf)为本站会员(hg158****2095)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

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

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开