课程设计(论文)题目:学生选修课管理系统设计学生姓名:邓康言学号:20141409班级: 计软所在院部: 广西科技大学指导教师:2015 年6 月学生选修课管理系统设计学生选修课管理系统设计摘要C语言课程设计和现代计算机技术的实际应用相结合,是我们在本阶段学完理论课程之后对自己该方面的能力的一次很好的检验,从开始的算法思路到运行调试后的美观的图形界面以及另人兴奋的可用程序,都是一个很好的学习和锻炼的过程。
使我们巩固了原有的理论知识,培养了我们灵活运用和组合集成所学过知识及技能来分析、解决实际问题的能力。
使我们体会到自身知识和能力能在实际中的应用和发挥。
不但可以激发创新意识,还可以开发创造能力、培养沟通能力。
这次学生选修课系统管理设计时间虽然仅有一个星期,但确实使我受益非浅。
通过学生选修课系统管理设计我丰富了计算机操作经验,更加深了对C语言的了解,熟悉了其环境,更增强了对Microsoft Visual C++ 6.0的使用技巧。
C语言是在国内外广泛使用的一种计算机语言。
语言功能丰富、表达能力强、使用灵活方便、既具有高级语言的优点,又具有低级语言的许多特点,适合编写系统软件。
同时,我觉得C语言应该是操作和理论相结合的课程,在不断地编写中去思考,两者是不可分割的。
我们在编写一个较大的程序时应该把它分开成几个小程序来看,这样会容易得多。
关键词:学生选修课系统管理;C语言课程设计;计算机技术;模块化程序设计;信息录入;浏览信息;选课;查询STUDENTS ELECTIVE COURSES MANAGEMENT SYSTEMDESIGNABSTRACTC language curriculum design and modern computer technology in the practical application of the combination, we are at this stage of learning theory course on their own side of the ability of a good test, from the beginning of the algorithm to run after the beautiful graphical interface and exciting available procedures, is a very good learning and training process. We consolidate the original theory of knowledge, cultivate our flexible application and integration of the knowledge learned and skills of analysis, ability to solve practical problem. So that we realize that their knowledge and ability in practical application and play. Can not only stimulate consciousness of innovation, also can develop creative ability, communication skills training. The student elective system management design time although only a week, but it does make me benefit. Students elective system management design my rich experience in computer operation, more deep understanding of the C language, familiar with the environment, more increased to Microsoft Visual C++ 6 using skills.The C language is widely used at home and abroad a computer language. Language feature-rich, expressive capability is strong, flexible and convenient use, not only has the advantages of high-level language, but also has many of the characteristics of low-level language, suitable for the preparation of system software.At the same time, I think C language should be the operation of combining theory and curriculum, constantly writing to think, the two are inseparable. Us in the preparation of a larger process should divide it into several small procedures, it would be much easier.Key words:students elective system management; C language curriculum design; computer technology; modular design; information; information query; selection;目录1、需求分析 (1)2.1概要设计 (1)2.1模块设计及图示 (1)2.2主函数流程设计 (2)3 详细设计 (3)3.1程序中的数据类型 (3)3.2函数运行过程详解 (3)4、设计和调试分析 (13)4.1 调试中遇到的问题 (13)4.2 算法复杂度分析 (15)4.3 经验和体会 (15)5、用户使用说明 (16)6、测试数据和测试结果 (16)参考文献 (22)1 需求分析假定有N门课程,每门课程有课程编号,课程名称,课程性质,总学分,授课学时,实验上机学时,学分,开课学期等信息,学生可按要求(如总学分不得少于60)自由选课。
要求设计一选修课程系统,使之能提供以下功能:(1)课程信息录入功能(课程信息用文件保存)---------输入;(2)课程信息浏览功能------输出;(3)查询功能:(多种查询方式:一种、任意两种组合、三种都能满足)------算法;(1)按学分查询(2)按课程性质查询;(3)按课程名称查询;要求:(1)用C语言实现系统,源程序要有适当的注释,使程序容易阅读;(2)函数功能要划分好(结构化程序设计);(3)至少采用文本菜单界面(如果能采用图形菜单界面更好);(4)可以增加新功能模块2 概要设计本程序功能模块根据程序设计的需求,综4.0合程序的实用性、智能化得考虑,将程序划分为6个模块分别编写:2.1 五个模块分别为:(1)浏览课程信息模块(2)查询课程信息模块(3)进入系统进行选课模块 (4)选课情况统计模块 (5)录入选课信息模块2.2 主函数的流程设计:学生选课系统执行主流程如图所示,先执行主函数 按键的有效键值为0~5输入。
各个按键的执行功能为:“1”:浏览已录入的选修课课程信息调用函数,“2”:通过不同的方式查找记录,调用函数search(); “3”:进入系统进行选课,调用函数xuan_ke();“4”:查看课程已选情况,调用函数“5”:录入选修课信息,调用函数input(); “0”:退出系统;3 详细设计3.1 程序中定义的数据类型3.1、1 定义与课程有关的结构体struct course{int num; /*课程编号*/char name[20]; /*课程名称*/char kind[10]; /*课程性质*/int taltime,ttime,etime,mark,term; /*课程时间,学分,开课信息等*/};3.1.2 定义与学生有关的结构体struct student{int snum;/*学生学号*/int cnum;/*所选课程编号*/char cname[20];/*所选课程名称*/};3.2 每个函数的过程详解3.2.1 void f1();函数原型:void f1();函数源程序:void f1()/*常用函数2*/{printf("\n课程编号课程名称课程性质授课学时实验或上机学时总学时学分开课学期:\n");}函数功能及实现:此函数仅包含输出语句,在课程信息输出之前调用此函数,打印出表头信息3.2.2 void menu();函数原型:void menu()函数源程序:void menu()/*主菜单*/{Printf(“\n\n\n”);printf(" 欢迎使用学生选课系统!\n");printf("************************************** \n");printf(" * 1-浏览选课信息2-查询选课信息* \n");printf(" * 3-进入选课操作4-选课情况统计* \n");printf(" * 5-录入选课信息0-退出选课系统* \n");printf("************************************** \n");printf(" 请选择输入选项编号(请先选择5进行课程信息录入): ");}函数功能及实现:此函数为输出菜单,进入系统后提示可根据供选择的项目进行后续操作。
3.2.3 void browser();函数原型:void browser();函数源程序:/*浏览选课信息*/void browser(){FILE *fp;/*定义指向文件的指针*/struct course c;/*定义课程结构体变量c*/if((fp=fopen("course.txt","r"))==NULL){printf("\nCannot open course!\n");}f1();for(;!feof(fp);) /*直到文件结束*/{fscanf(fp,"%d %s %s %d %d %d %d %d\n",&c.num,&,&c.kind,&c.ttim e,&c.etime,&c.taltime,&c.mark,&c.term); /*将课程信息写入文件*/ printf("%5d%12s%9s%9d%12d%12d%8d%9d\n",c.num,,c.kind,c.ttime,c. etime,c.taltime,c.mark,c.term);/*格式化输出*/}fclose(fp);/*关闭文件*/menu();}函数功能及实现:此函数先定义指向文件的指针*fp,课程结构体变量c,通过if语句判断文件是否存在,在调用函数f1(),输出表头信息,通过for 循环并使用fscanf函数将文件中的课程信息读出并通过printf打印到屏幕上,再通过fclose函数关闭文件。