


版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1设计目的32 设计题目及要求33设计算法分析33.1模块调用层次图33.2 核心算法描述43 . 3 系统特点64程序代码65调试情况86结论11学生信息管理1. 设计目的本课程设计的目的就是要通过一次集中的强化训练,使学生能及时巩固已学的知识,充未学的但又必要的内容。 进行课程设计目的在于加深对程序设计基础中基础理论和基本知 识的理解,促进理论与实践的结合,进一步提高程序设计的能力。具体目的如下:1 使学生更深入地理解和掌握该课程中的有关基本概念,程序设计思想和方法。2 培养学生综合运用所学知识独立完成课题的能力。3 培养学生勇于探索、严谨推理、实事求是、有错必改,用实践来检验理论,全方位
2、 考虑问题等科学技术人员应具有的素质。4 提高学生对工作认真负责、一丝不苟,对同学团结友爱,协作攻关的基本素质。5 培养学生从资料文献、科学实验中获得知识的能力,提高学生从别人经验中找到解 决问题的新途径的悟性,初步培养工程意识和创新能力。6 对学生掌握知识的深度、运用理论去处理问题的能力、实验能力、课程设计能力、 书面及口头表达能力进行考核。2. 设计题目及要求【1】设计题目【2】要求实现如下功能:(1) 建立学生信息的结构体(2) 学生信息的初始化(可以从文件获取)(3) 学生信息的添加、修改、删除、查找(4) 学生信息的输出(5) 对学生信息按学号、成绩排序(6) 计算一门课的平均分和总
3、分(7) 将学生信息保存为文件综合应用数组、指针、结构体、文件等,对该设计题目进行设计和实现。课 程设计完成后,提交课程设计报告。3. 设计算法分析3.1模块调用层次图【1】变量描述定义形式/名称含义/作用数组char n ame20定义姓名数组结构体struct stude nt stu50声明一个结构数组全局变量int in put=0;float ave,sum;全局变量标记当前录FILE *fp;入学生个数文件stuist2.doc保存学生信息函数SaveIn putStuDelStu保存录入删除修ModifyStu Fin dStu In sertStu改查找插入排序SortStu
4、ListStu显示学生信息【2】系统模块调用层次图MainSaveIn putStuDelStuModifyStuFin dStuIn sertStuSortStuListStufX开始L3.2核心算法描述1.总体模块流程图:学生信息修改查询插入删除排序保存结束V3查询模块:6排序模块:-Tchose=F(chose=2)for(i=0;ii nput-1;i+)for(i=0;ii nput_1;i+)for( j=i+1;jinput;j+)for( j=i+1;jstuj.numstui.avestuj.ave/T、FT、Ftemp=stuitemp=stuistui=stujstui=
5、stujstuj=tempstuj=temp3.3系统特点【1】特点:这个学生信息管理系统建立了学生信息的结构体,实现了学生信息的录入、添加、修改、删除、查找等功能,并能计算学生的平均分和总分,对学 生进行排序。4. 程序代码【1】程序代码void Help();void Save(struct stude nt stu);void In putStu(struct stude nt stu);void DelStu(struct stude nt stu);void ModifyStu(struct stude nt stu);void Fi ndStu(struct stude nt st
6、u);void In sertStu(struct stude nt stu);void SortStu(struct stude nt stu);void ListStu(struct stude nt stu);void mai n()int in;int ini;char ch;void In putStu(struct stude nt stu) pp=stu;system(cls);int i;prin tf(Number of stude nts you want to en ter in formati on:);sca nf(%d,&in put);if(fp=fope n(i
7、 nputdata.sys,wb+)=NULL)printf(Cannot open file strike any key exit!);getch();exit(1); void ModifyStu(struct stude nt stu) system(cls);pp=stu;int id,i,flag=1;if(fp=fope n( modifydata.sys,wb+)=NULL)printf(Cannot open file strike any key exit!);getch();exit(1); void Fin dStu(struct stude nt stu) syste
8、m(cls); int i=0,id,flag=1,chose;prin tf(nPlease select query: 1.N o. inq uiries by school;2.Query by class;3.Queryby n amen);sca nf(%d,&chose);The sec ond subjectThe sec ond subjectswitch(chose)case 1:prin tf(Please en ter your query No. stude nts:);sca nf(%d,&id);for(i=0;ii nput;i+) if (stui. num=i
9、d) flag=0;stui.sum=stui.score1+stui.score2+stui.score3; stui.ave=stui.sum/3;prin tf(nNo. Studies Name No. classes The first subjec The third subjectAverage Totaln);void In sertStu(struct stude nt stu) system(cls);int flag=1;pp=stu;int i,id;if(fp=fope n(i nsertdata.sys,wb+)=NULL)printf(Cannot open fi
10、le strike any key exit!);getch();exit(1); void ListStu(struct stude nt stu) int i=0;for(i=0;ii nput;i+) stui.sum=stui.score1+stui.score2+stui.score3;stui.ave=stui.sum/3;prin tf(nNo. Studies Name No. classes The first subjecThe third subjectAverage Totaln);for(i=0;ii nput;i+)pri ntf(n%d%s%dt%dt%dt%dt
11、%d%d,stui. nu m,stui. name,stui.classid,stui.score1,stui.score2,stui.score3,stui.ave, stui.sum);getch(); void DelStu(struct stude nt stu) system(cls);pp=stu; int delnu m,flag=1;char ask;int i,j;if(fp=fope n(Deldata.sys,wb+)=NULL) printf(Cannot open file strike any key exit!);getch();exit(1); void So
12、rtStu(struct stude nt stu) system(cls);int i,j,chose;struct stude nt temp;prin tf(To sort the data before:n);prin tf(nNo. Studies Name No. classes The first subjecThe sec ond subjectThe third subjectAverage Totaln);for(i=0;ii nput;i+)pri ntf(n %d%s %d %dt %dt %dt %dt %dn,stui. nu m,stui. name,stu i.
13、classid,stui.score1,stui.score2,stui.score3,stui.ave,stui.sum);printf(n1.Sort by Student IDt2.By the average score (high void Save(struct stude nt stu) int i,j; pp=stu;system(cls);prin tf(nnnn tttSavi ng);if(fp=fope n( stu_list2.doc,wb+)=NULL)printf(Cannot open file strike any key exit!);getch();exi
14、t(1);【2】程序执行结果Sau ingr*Sti.iden t InFoi*iTiat ion Mmagenent Si/st en* k卜和其轉屛耳建w叱L. In format;久。口 pmirtli&n耳nc辱卄十 严耳玄鳶料箕料直耳迄-1nf oi*na t ion JO J X X H JC X M 3 .Statist ICS 梵X算氧耳簟覽址貝算rosrr-a.ni tcrninacian三科成绩、平均分、总分不能用float定义应改为intErt*op fl ,TKT 47: Declaracion syntax errorUftRNING:Cancel7,TXT dteZ
15、time of disk file has changed Reload from disk?定义应在函数的最前端 Error t-2&.GPP 234: Function 1 strcmp should haue a prototype文件未定义*student InFornation Management Systen* 幵 ww wwwwhTMw:! F I nFovnation naintenance* mjtKjcjcZ . nf ornatian頁 X M: K X JM )CC JC? B 8 t at is: t ic S HXXXXHXXXXKKXKKiMKJgZMaOf*
16、M 員萱 X 良虹)C 比 4 e X is: t JHXHXKXMLKfOCKXKXMLKKXKKXKJtKJOt *Please car-f&ct choice- 1* *fi严寻t InfoTrt盘匸ion maintenance* M-*1create student recore file* mmmwxmwk2.Add Student RecopdswMWMMMMMMMxx *3.Student record to delet* *4. An&nd the student records*. Retutn to preuious menuMKKJt3tlt3f lease corre
17、ct cho=1Nunhe v of students: you uant to enter dnf oriictt ion : 1Please ente- the torrcGtEnter the f irst 1 ninber of school students ;12No 1 entep 七lie nanes oF students =lijjPlease entei- the nunber of classes students :1he first subjec: 78be second subject: 89 lie third subject: ?6这是建立学生信息文件mwmw
18、mw4b Hniend the student records*5 Return to preu iousPlease correct choice;2huiu.n ic liarude xue haoake siitE that you want to inset*t No. students :yame of student inputjjj_ leaise enter the number of classes tudenit;ane of studernt input童* 春量 鲁 * 怪書* 豪* 豪* 着嵌 # 鲁 窶春* 豪*豪*1-1n ini i-i iTiT n ii-i
19、n n n i-i m n m nm-in n n n n jl- m n n nilweniU 78Idkeriu:66夢* w 严 w * *n to proulouc nonu* k*Plcase cotrect choice:3Please enter pou UAnt to de丄ete Nd. students:!Uhefhei or not to conFiin tPie de let7 3.Qn nLimbei ic 1 schac 1 inFormt i.an u-iu|hNot thE students you want to d日“tE学|找不到要删除的学生信息M*mmk
20、mkmxkmX . create student recore fKwxMHJtxxMZ-Add student Hecordsmmkmkmmmmmmk *3.Student record to delete* kmkmmmmmM. Anend the student records* hk杯牙.Return to preu ious nenuMMMwwMM *Please coirect cho ice :3Flease enter you wint tu delece No. students :12Uhethei* ar not 七o conf irm the: ddetian number is 12 school Infcrmation (y rnd|d|j|Delete success?Deleted data:Ho. 3琨 5 心 4皿 FZ5ectAnerage TotalMJQ* 小卡 tanft!?ex2721删除了学号为12的学生信息Eaue found Che InfOMneit ion you ua.n tstudentso. of neu students enter
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 运营管理中的挑战与应对策略计划
- 仓库设备维护管理倡议计划
- 《贵州德力能源有限公司纳雍县新房乡营龙煤矿(变更)矿产资源绿色开发利用方案(三合一)》评审意见
- 组装机箱知识培训课件
- 2025年阿拉善盟年货运从业资格证考试题库
- 2025年武汉货运资格考试答案
- 2025年乌鲁木齐货年从业资格证考试题目
- 2025年福州货运从业资格证考试题库答案解析
- 第5课+古代非洲与美洲+高一下学期统编版(2019)必修中外历史纲要下
- 0-3岁婴幼儿游戏知到课后答案智慧树章节测试答案2025年春青岛职业技术学院
- 2024电站锅炉管内压蠕变试验方法
- 新电子税务局培训课件(20240510)全国统一规范电子税务局试点纳税人培训
- 2024年内蒙古北方职业技术学院单招职业适应性测试题库带答案
- 《研学旅行课程设计》课件-研学课程方案设计
- 11G521-1钢檩条标准完整版
- 2024年资格考试-WSET二级认证笔试参考题库含答案
- 招标代理机构选取招标代理工作实施方案
- 新能源汽车产业专利分析综述
- 可防性案件知识讲座
- 揭秘《红楼梦》中的家族兴衰贾家命运如何
- 职场化妆穿搭培训课件
评论
0/150
提交评论