您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > C++课程设计学生成绩管理-[文档在线提供]
学校C++程序设计课程设计报告选题名称:成绩管理系(院):专业:班级:姓名:学号:指导教师:学年学期:~学年第学期年月日摘要:随着科学技术的发展,计算机领域不断取得新的研究成果。计算机在代替和延伸脑力劳动方面发挥越来越重要的作用,不仅在工业方面而且在日常生活中也越来越离不开计算机。尤其是在学校里,要处理大量的学生数据。随着科学技术的不断提高,计算机科学日渐成熟,其强大的功能已为人们深刻认识,它已进入人类社会的各个领域并发挥着越来越重要的作用.作为计算机应用的一部分,使用计算机对学生成绩信息进行管理,有着手工管理所无法比拟的优点。学生成绩管理系统能方便用户迅速、准确处理学生的成绩,得到想要的数据并能将学生的信息以文档保存。本文介绍了简易学生成绩管理系统在MicrosoftVisualC++6.0环境下的实现过程:系统的分析,功能模块的设计,系统的调试和测试。此系统的主要管理的信息有:学生的班级,学号,姓名和三(可以更改)门课的成绩。本系统的主要功能有学生成绩的添加、删除、插入、显示,能对学生成绩按分数或学号进行排序,可以根据用户的要求按班级,姓名,学号查询学生的成绩信息,计算每位学生的总分和均分,计算所有同学的总分和平均分,分类汇总统计每门课的的总分均分能保存信息到文件以及从文件中读取信息等功能。关键词:学生成绩管理系统;功能模块(函数);指针;结构;链表;文件保存及读取。目录1需求分析································································································11.1功能需求分析:·················································································································11.2环境需求分析:·················································································································11.3方法需求分析····················································································································12概要设计································································································22.1系统功能模块图·················································································································22.2设计思想:························································································································23详细设计································································································33.1设计原理···························································································································33.2主要代码描述····················································································································33.3程序详细代码····················································································································73.4系统界面·························································································································164调试与操作说明·····················································································174.1调试过程··························································································································174.2操作说明··························································································································24总结·······························································································25致谢·······························································································26《C++程序设计课程设计报告》11需求分析1.1功能需求分析:简易学生成绩管理系统主要有4个大的模块:学生成绩从文件读入和写入,学生成绩的输入和删除,学生成绩信息的查询,以及学生成绩的分类汇总。1.11学生成绩的读入和写出模块主要功能是读出要管理的成绩文档,保存修改后的成绩文档。实际生活中学生成绩的文件主要以word或excel保存,为了方便操作我在调式本系统中成绩文件采用了txt的文档格式保存,当然以word文档形式保存也是可以的。1.12学生成绩输入删除模块主要功能是输入、追加、删除学生成绩的操作。添加操作是根据用户的要求实现的。例如用户可以输入要删除学生的学号删除学生的信息。此程序输入学生成绩时就计算个人的总分和均分,并保存到数据结构中相应的变量中。1.13学生成绩的查询模块主要功能是按照用户的要求查询学生的成绩。其中用户可以选择查询单个学生的成绩还是某个班级的成绩,成绩查询中包括个人学生的总分和平均分,。1.14学生成绩的分类汇总模块统计主要功能是某个班级的每门学科的总分和平均分。1.2环境需求分析:操作系统:WindowsXP开发软件:VisualC++6.01.3方法需求分析由于数组存放数据的时候要先确定数组的规模,不能动态的分配内存空间,而单链表是非连续存放的,可以对内存空间进行动态分配,此系统是用单链表完成的。然后定义链表的结点类型为结构就可以实现对学生学号、姓名、成绩、班级等学保存。每次只要返回头指针,就可以对整个链表进行操作,因此选链表来存放学生信息。《C++程序设计课程设计报告》22概要设计2.1系统功能模块图2.2设计思想:学生成绩管理系统是用面向对象的方法设计,由于数组的存放是连续的,而单链表是非连续存放的,是动态分配内存空间,因此此系统采用单链表来完成。各个功能模块的实现主要转变到对单链表的遍历,添加和删除结点。学生成绩管理系统链表的初始化输入学生成绩删除学生成绩显示学生成绩按姓名找学生保存学生成绩读取学生成绩计算总分均分学生成绩排序按学号查成绩分类合计《C++程序设计课程设计报告》33详细设计3.1设计原理学生成绩管理系统以菜单选择,通过调用各个函数,对单链表的遍历,实现不同的功能,不同函数处理后返回的只是一个头结点,但是通过头结点可以找到所有链表中的信息,只要有函数,找到头指针就能进行相应的操作,所以模块化的程序方便以后添加或者删除某些功能,程序中通过system(“cls”)清屏函数实现界面的转换,主函数中的循环保证程序不会退出,一个循环和一个清屏函数实现了主菜单和各子画面的切换(子函数)。这样的话各个子函数都可以调用一开始输入的数据,这样就实现了各个不同函数调用时都能使用整个系统连续起来了。作为一个学生成绩管理系统,增加了文件的读入和写出功能,增加了程序的实用性。3.2主要代码描述3.21学生信息输入的实现;通过创建单链表,对链表中各个结点,而此结点是结构类型的,可以给各个结点赋不同学生的的信息,输入后就把各个学生的总分、均分计算好并存入结构变量中。最后返回的是头指针,主函数只要找到这个头指针就可以对其进行需要的操作。创建链表的具体代码如下://创建链表student*creat(){inti;ints;student*h=NULL,*ps1,*pend1;charflag;system(cls);cout请输入信息...endl;do{ps1=newstudent;//开辟一个新的结点cout输入班级:;cinps1-cla;cout输入学号:;cinps1-no;cout输入姓名:;cinps1-name;cout请输入N门课的分数endl;s=0;《C++程序设计课程设计报告》4for(i=0;iN;i++){do{cout输入第i+1门课成绩:;cinps1-score[i];if(ps1-score[i]100||ps1-score[i]0)cout输入的成绩不正确,请重新输入'\n';}while(ps1-score[i]100||ps1-score[i]0);s=s+ps1-score[i];}ps1-sum=s;ps1-average=(float)s/N;ps1-order=0;//未排序前此值为0if(h==NULL)h=ps1;elsepend1-next=ps1;pend1=ps1;//创建链表cout是否继续输入学生信息(yorn)?;cinflag;}while(flag=='y'||flag=='Y');//提示是否继续输入学生的信息pend1-next=NULL;//给链表尾赋空值returnh;}3.22学生成绩删除的实现删除学生成绩是这样实现的:通过两个辅助指针找到链表中要删除的学生信息所在的结点,让辅助指针的前驱辅助指针指向辅助指针的后一结点,这样辅助指针所指项就自动从链表中删除了,然后输出该学生的信息以确认是否是该学生,是的话按任一键就可删除,最后返回头指针。具体代码如下://删除记录student*delet(student*h){system(cls);student*ps2,*pend2;chars[30];cout输入要删除记录的学号:endl;cins;pend2=h;ps2=h;while(strcmp(ps2-no,s)&&ps2!=NULL)//当记录的学号不是要找{pend2=ps2;//将p的指针赋给q指针作为p的前驱指针《C++程序设计课程设计报告》5ps2=ps2-next;//将p指向下一条记录}if(ps2==NULL)//如果p为空,说明链表中没有该结点cout没有学号为
本文标题:C++课程设计学生成绩管理-[文档在线提供]
链接地址:https://www.777doc.com/doc-6336248 .html