




已阅读5页,还剩16页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
某高校学籍管理系统设计书2设计说明2.1 问题描述与功能设计1问题描述: 设计一个高校学籍管理系统,能够处理学生个人的学籍信息、按学生学籍号进行排序,在实现各功能时要有一定的异常处理机制,给用户适当的操作错误提示,要求将学生个人的学籍信息保存在文件中。 2. 功能要求:1增加某新学生的信息2删除某学生的信息3修改某学生的信息4输出符合某种特征的学生信息列表(选做以下任意模块)。l 按名称升序(降序)输出学生列表l 按某门成绩升序(降序)输出学生列表l 按学号升序(降序)输出学生列表5根据提供的学生姓名输出该学生的信息6以下两个模块任选一个l 输出特定班级的学生信息列表l 输出特定学号范围的学生信息列表2.2 算法与数据结构算法:本程序主要是用了链表的方式来组织数据的,每一个数据都是保存在链表中的,并且都要通过指针来连接。还用了类来实现各种功能。充分体现了面向对象的优越性。数据结构:本程序是包括了对数据集合中的各元素以各种方式进行操作,包括删除、查找、排序等。 数据的组织方式也有所不同。student类里面存放的是所要用到的各种数据类型,及成员函数,而student类的实现里面主要是存放着定义好的函数实现。2.3 函数定义void content();/功能菜单student * creatlist(int n);/创建链表student * addlist(int n,student*head); /增加学生student * deletlist(int n,student*head);/删除学生void outputlist(student * head);/输出学生信息int findlist(student * head);/按名字查找学生个人信息student * changelist(int n,student*head);/修改学生个人信息void sortList( int n,student *head);/把学生按照学号进行排序void classstudent(student * head);/输出特定班级的学生信息2.4 界面设计2.5 测试 1. 输出学生信息2. 删除学生信息3. 把学生按照学号进行排序4按名字查找学生个人信息4输出特定班级的学生信息5修改学生个人信息6 增加学生信息总结 经过本次的课程实验的制作,加深了我对C+中链表的认识,也学会了如何运用链表。感觉自己又进步了一点点,并进一步激发了对高级语言学习的兴趣,体验到了编程的乐趣。 但在刚开始编写源代码的同时也感觉到自己本身的不足,看到题目后不知道如何下手,心里就连基本的函数模型也勾画不出,严重打击了编写程序的自信心。归根结底还是自己对链表的认识也很模糊,课前的预习和课后的复习没有做好,意识到自己的学习习惯上的严重不足。经过上网查询有关资料加上以书本为模板,也向寝室室友的请教,逐渐认识了链表的本质,慢慢的写出了函数的雏形,通过多次的查错改错,程序最终可以运行了。但经过输入数值进行调试的时候,发现达不到预期目的。然后通过对各种功能模块的修改,程序最终达到了预期目标,成就感高涨,心里的石头也终于落了地,踏破铁鞋无觅处,得来全不费工夫。总而言之,收获颇多,一步一个脚印,为自己成为一个合格的软件工程师打下基础。参考文献1 钱能. C+程序设计教程M. 北京:清华大学出版社,2005:315-324,415-418,423.2 刘瑞新. Visual C+面向对象程序设计教程M. 北京:机械工业出版社,2005.3 王挺等 C+程序设计教程M. 北京:清华大学出版社。流程图 附录A#include#includestruct studentchar name20;int English,Math,Physical;int Class;int Grade;int Number; student*next;void content();student * creatlist(int n);student * addlist(int n,student*head);student * deletlist(int n,student*head);void outputlist(student * head);int findlist(student * head);student * changelist(int n,student*head);void sortList( int n,student *head);void classstudent(student * head);/ 主函数int main() int n,num; student * listhead=NULL; cout-欢迎进入学生信息管理系统- endl; listhead=creatlist(n); content(); while(num) cout请输入功能对应的数字:num; switch(num) case 0: cout 欢迎使用本系统!endl; return 0; case 1: outputlist(listhead); coutendl; content(); break; case 2: coutn; listhead=deletlist(n,listhead); cout删除成功!endl; content(); break; case 3: coutn; listhead=changelist(n,listhead); cout修改成功!endl; content(); break; case 4: sortList(n,listhead); cout排序成功!endl; content(); break; case 5: findlist(listhead); coutendl; content(); break; case 6: int n; cout请输入你要增加学生的个人信息!endl; listhead=addlist(n,listhead); coutendl; content(); break; case 7: classstudent(listhead); coutendl; content(); break; default: cout您的输入有误!; return 0;void content(void)/功能菜单 cout *-*-*-*-*-*-*菜单 *-*-*-*-*-*-*endl; cout 输出新学生的信息 *endl; cout 删除某学生的信息 *endl; cout 修改某学生的信息 *endl; cout 按学号升序把学生排序 *endl; cout 输出某个学生 *endl; cout 增加某新学生的信息 *endl; cout 输出特定班级的学生信息列表*endl; cout 退出程序 *endl; cout *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*endl;/创建学生信息列表student *creatlist(int n)coutn; head=new student; if(head=NULL) cout计算机没有为系统分配内存!endl; return NULL; else couthead-name; couthead-Number; couthead-Math; couthead-English; couthead-Physical; couthead-Class; couthead-Grade; head-next=NULL; for(int i=0;in-1;i+) temp=new student; if(temp=NULL) cout计算机没有为系统分配内存!endl; return head; else couttemp-name; couttemp-Number; couttemp-Math; couttemp-English; couttemp-Physical; couttemp-Class; couttemp-Grade; temp-next=head; head=temp; return head;/增加某新学生的信息student * addlist(int n,student*head)student*curstudent=head;student*prestudent=NULL;student*newstudent=NULL;while(curstudent)prestudent=curstudent;curstudent=curstudent-next;newstudent=new student;if(newstudent=NULL) cout计算机没有为系统分配内存!endl; return head; coutnewstudent-name; coutnewstudent-Number; coutnewstudent-Math; coutnewstudent-English; coutnewstudent-Physical; coutnewstudent-Class; coutnewstudent-Grade; if(prestudent=NULL)newstudent-next=curstudent;return newstudent;elseprestudent-next=newstudent; newstudent-next=curstudent;return head;/删除某学生的信息student*deletlist(int n,student*head)student * curstudent=head;student * prestudent=NULL;while(curstudent&curstudent-Number!=n)prestudent=curstudent;curstudent=curstudent-next;if(curstudent=NULL)cout你所要删除的学生的学号不存在!next;elseprestudent-next=curstudent-next;delete curstudent;return head;/ 输出学生信息列表void outputlist(student * head) student * curstudent=head; coutendlendl; cout*学生的个人信息列表*endl; cout姓名t学号t班级t年级t数学t英语t物理endl; while(curstudent) / 遍历链表 coutnametNumbertClasstGradetMathtEnglishtPhysical; if(curstudent-next) coutnext; coutNumber=n) cout *学生原始信息* endl; cout姓名t学号t班级t年级t数学t英语t物理endl; coutnametNumbertClasstGradetMathtEnglishtPhysicalendl; cout*请重新输入该学生的信息*endl; couthead-name; couthead-Number; couthead-Math; couthead-English; couthead-Physical; couthead-Class; couthead-Grade; return head; curstudent=curstudent-next; cout您输入的学号有误!; return NULL; /输入某个学生的名字,输出该学生信息int findlist(student * head) char name120; coutname1; student * curstudent=head; cout姓名t学号t班级t年级t数学t英语t物理name,name1)=0) coutnametNumbertClasstGradetMathtEnglishtPhysical; return 0; curstudent=curstudent-next; cout对不起,你所要找的学生不存在!endl; return 0;/ 输出特定班级的学生信息列表void classstudent(student * head) int Class1; coutClass1; student * curstudent=NULL; curstudent=head; cout在Class1班的学生有endl; cout名字t年级t班级t学号t数学t物理t英语tClass=Class1) coutnametNumbertClasstGradetMathtEnglishtPhysical; coutnext;
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 家禽消毒室管理制度
- 应急局科室管理制度
- 彩票发行费管理制度
- 微信技师房管理制度
- 德克士值班管理制度
- 快递分拣站管理制度
- 急救室专人管理制度
- 总经理聘任管理制度
- 感控办部门管理制度
- 成品库出货管理制度
- 医院培训课件:《肩周炎》
- 安全生产月关爱生命注意安全
- 2024年中国家用水处理机市场调查研究报告
- 2024年版《输变电工程标准工艺应用图册》
- 2024年海南省中考数学试卷真题及答案详解(精校打印)
- DL∕T 788-2016 全介质自承式光缆
- 陕西省安康市石泉县2023-2024学年八年级下学期期末考试物理试题
- IT系统集成项目实施与售后方案
- 新疆省新疆生产建设兵团2024年六年级下学期5月模拟预测数学试题含解析
- 北京市昌平区2022-2023学年四年级下学期数学期末试卷(含答案)
- 2025届自贡市重点中学高一下数学期末统考模拟试题含解析
评论
0/150
提交评论