关闭

关闭

封号提示

内容

首页 学生成绩管理系统+++数据结构课程设计.doc

学生成绩管理系统+++数据结构课程设计.doc

学生成绩管理系统+++数据结构课程设计.doc

上传者: 淡蓝色的 2011-12-09 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《学生成绩管理系统+++数据结构课程设计doc》,可适用于IT/计算机领域,主题内容包含算法与数据结构课程设计学生成绩管理系统学年度第二学期赣南师范学院数学与计算机科学学院《算法与数据结构课程设计》综合实验课程设计名称:学生成绩管理系统符等。

算法与数据结构课程设计学生成绩管理系统学年度第二学期赣南师范学院数学与计算机科学学院《算法与数据结构课程设计》综合实验课程设计名称:学生成绩管理系统专业:计算机科学与技术班级:计本()班学号:姓名:杨倍平指导教师:曾春梅老师学生成绩管理系统、问题的描述和分析问题的描述  随着社会的发展和经济时代的到来管理信息系统在各行各业都越来越重要特别是教育事业。在经济发达的国家许多教育机构(如公办、私立、培训机构等)都投入了大量的资金开发MIS系统以求在将来激烈的竞争中立于不败之地。在我国民办教育是新兴的一个行业是随着改革开放和市场经济的发展根据中国特有的国情发展起来的特别是中国民办教育促进法的出台从一定的程度上规范和促进了中国民办教育的发展这是一个很有发展前途的新兴产业但是同发达国家相比我国的民办教育行业的信息技术的应用程度还很低只有在大城市中发展较早、规模较大的民办院校中才使用计算机进行大规模操作从各方面提高工作效率取得良好的社会和经济效益而一些新兴的、规模较小的民办机构还没有全部具备这种功能。因此可见随着我国民办教育的迅速发展信息技术在其上的应用会更加地广泛和深入。现有系统存在问题的分析 有的学校根本就没有系统还是手工操作计算机日新月异的发展但是有的领导只见眼前利益不关心甚至不敢尝试新兴的事物。手工操作还十分落后效率极低成本很大以后的社会是信息的社会信息只有快准精才能发挥其价值。 所以机器代替人力是必然的历史发展趋势只有领导的重视和支持才能从人工操作改为计算机的自动化系统。人工操作必将被计算机代替。 有些学校虽使用了计算机甚至管理系统但是仍然存在很多问题问题一日不解决效率就一日提不上去。 还有有的系统很不完善到处是漏洞可以说是千疮百孔这样极不完善的系统能有保障吗?所以制作一个完善的学生管理系统是必不可少的。二、数据结构的设计structperson{charnamelongnumfloatmathfloatEnglishfloatchinesefloataveragefloatsum}student三、模块:学生成绩管理系统模块四、算法的设计在此成绩管理系统中要求用户输入的只是有字符型和数值型数据所以我设计了下面函数来处理并对输出的数据进行检验。intN=Enter(){FILE*fpcharchcharchcharnumstrstructpersonstudentclrscr()fp=fopen("jietxt","ab")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{do{printf("yourname:")gets(studentname)printf("nyournum:")gets(numstr)studentnum=atol(numstr)printf("nyourmath:")gets(numstr)studentmath=atof(numstr)printf("nyourEnglish:")gets(numstr)studentEnglish=atof(numstr)printf("nyourchinese:")gets(numstr)studentchinese=atof(numstr)studentsum=studentchinesestudentmathstudentEnglishstudentaverage=studentsumfwrite(student,sizeof(structperson),,fp)Nprintf("Doyoucontinueaddingotherstudents(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')}printf("Showall(YN)n")ch=getchar()getchar()if(ch=='y'||ch=='Y')Listall()fclose(fp)returnconfirm()clrscr()}查询学生记录当用户执行此查询任务时系统会提示用户进行查询字段的选择即按学号或按姓名进行查询。若此学生记录存在则会打印输出此学生记录的信息。Search(){charchoicecharchcharchcharchcharchcharnamelongnumcharnumstrclrscr()printf("***WAYSOFSEARCHING***n")printf("n")printf("**name**n")printf("**num**n")printf("n")printf("giveyourchoice:n")choice=getchar()getchar()while(choice>''||choice<''){printf("Sorryyourchoiceiswrongnpleasegiveacorrectone:n")choice=getchar()getchar()}根据姓名或学号进行查找switch(choice){case'':do{Loop:printf("inputthenameofstudentsyouwanttosearch:n")gets(name)Search(name)printf("GOONSEARCHINGBYNAEM(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')printf("Searchbyotherways(YN)n")ch=getchar()getchar()if(ch=='y'||ch=='Y')gotoLoopbreakcase'':do{Loop:printf("inputthenumofstudentsyouwanttosearch:n")gets(numstr)num=atol(numstr)Search(num)printf("GOONSEARCHINGBYNUM(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')}}Search(longnum){FILE*fpcharchintflag=inttclrscr()fp=fopen("jietxt","rb")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{flag=t=while(fread(student,sizeof(structperson),,fp))if(num==studentnum){printf("namettnumtchinesetEnglishtmathsumtaveragen")printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)t=break}if(t==)printf("Sorrythestudentyouaresearchingnotexistedn")rewind(fp)}fclose(fp)}Search(char*name){FILE*fpcharchintflag=inttclrscr()fp=fopen("jietxt","rb")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{flag=t=while(fread(student,sizeof(structperson),,fp))if((strcmp(name,studentname))==){printf("namettnumtchinesetEnglishtmathsumtaveragen")printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)t=break}if(t==)printf("Sorrythestudentyouaresearchingnotexistedn")rewind(fp)}fclose(fp)}Delete(){FILE*fpstructpersonstudent,studentintiintkintjintflagcharchcharnamecharchcharchclrscr()fp=fopen("jietxt","rb")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{do{i=j=flag=printf("inputthenameofstudentsyouaregoingtodeleten")scanf("s",name)while(fread(student,sizeof(structperson),,fp)==){if((strcmp(name,studentname))!=){studentj=studentj}else{flag=printf("nametttnumtchinesettEnglishttmathtsumtaveragen")printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)printf("Delete(YN)n")ch=getchar()getchar()toupper(ch)if(ch=='N')gotoLoop}}printf("j=dn",j)k=ji=fclose(fp)if(flag==)printf("Sorrythestudentyouaresearchingnotexistedn")if(flag==)printf("Congratulation!yousucceed!!!n")fp=fopen("jietxt","wb")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{i=do{fwrite(studenti,sizeof(structperson),,fp)i}while(i<k)}Loop:getchar()printf("Goon(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')printf("Showall(YN)n")ch=getchar()getchar()if(ch=='y'||ch=='Y'){rewind(fp)printf("nametttnumtchinesettEnglishttmathtsumtaveragen")while(fread(student,sizeof(structperson),,fp)){printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)}}}fclose(fp)returnconfirm()}修改学生记录在修改学生记录操作中系统会先按输入的学号或姓名查找该记录然后提示用户修改学号或姓名之外的值但学号或姓名不能修改。Revise(){FILE*fpcharchcharchlongoffset=sizeof(structperson)intflag=charnumstrcharnameclrscr()fp=fopen("jietxt","rb")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{again:printf("nameofrivesingstudent:n")gets(name)do{flag=fread(student,sizeof(structperson),,fp)if((strcmp(name,studentname))==){flag=printf("thefollowingisinformationofstudentbeingdeleted:n")printf("namettnumtmathtchinesetEnglishtsumtaveragen")printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)do{printf("***informationsforrevising***n")printf("====================================n")printf("#namenum#n")printf("#mathEnglish#n")printf("#chinesetotal#n")printf("====================================n")printf("giveachoice:n")ch=getchar()getchar()while(ch>''||ch<''){printf("Sorryyouputiswrongnpleaseinputanotherchoice:n")ch=getchar()getchar()}switch(ch){case'':assrevise("name")gets(studentname)breakcase'':assrevise("num")gets(numstr)studentnum=atol(numstr)breakcase'':assrevise("math")gets(numstr)studentmath=atof(numstr)breakcase'':assrevise("English")gets(numstr)studentEnglish=atof(numstr)breakcase'':assrevise("chinese")gets(numstr)studentchinese=atof(numstr)breakcase'':assrevise("total")gets(studentname)assrevise("num")gets(numstr)studentnum=atol(numstr)assrevise("math")gets(numstr)studentmath=atof(numstr)assrevise("English")gets(numstr)studentEnglish=atof(numstr)assrevise("chinese")gets(numstr)studentchinese=atof(numstr)}studentsum=studentchinesestudentmathstudentEnglishstudentaverage=studentsumprintf("Continuerevisingthesamestudent(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')fseek(fp,offset,)fwrite(student,sizeof(structperson),,fp)printf("thefollowingisinformationofstudenthadbeenrevised:n")printf("namettnumtmathtchinesetEnglishtsumtaveragen")printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)printf("Congratulation!yousucceed!!!n")break}}while(fread(student,sizeof(structperson),,fp))rewind(fp)if(flag==)printf("Sorrythestudentofrevingnotexistedn")printf("GOONRevising(YN)n")ch=getchar()getchar()if(ch=='y'||ch=='Y')gotoagain}fclose(fp)returnconfirm()clrscr()}对学生记录进行排序Order(){FILE*fpcharchcharchintkfloata,b,c,dstructpersonstudentinticharchfp=fopen("jietxt","rb")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}rewind(fp)i=while(fread(studenti,sizeof(structperson),,fp))ik=ido{for(i=i<ki){ai=studentimathbi=studentiEnglishci=studentichinesedi=studentiaverage}printf("***WAYSOFORDER***n")printf("========================n")printf("*mathEnglish*n")printf("*chineseaverage*n")printf("=========================n")printf("pleasegiveachoice:n")ch=getchar()getchar()while(ch<''||ch>''){printf("Sorrythedateyouinputiswrongnpleasegiveanotherchoice:n")ch=getchar()getchar()}switch(ch){case'':Order(a)breakcase'':Order(b)breakcase'':Order(c)breakcase'':Order(d)break}printf("Congratulation!yousucceed!!!n")printf("Goonordering(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')printf("Showall(YN)n")ch=getchar()getchar()if(ch=='y'||ch=='Y'){rewind(fp)printf("nametttnumtchinesettEnglishttmathtsumtaveragen")while(fread(student,sizeof(structperson),,fp)){printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)}}fclose(fp)returnconfirm()}Order(float*p){FILE*fpinti=intkintjstructpersonstudentstructpersonstudentclrscr()fp=fopen("jietxt","r")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{while(fread(studenti,sizeof(structperson),,fp))ik=ii=while(i<k){for(j=ij<kj)if(pi<pj){student=studentistudenti=studentjstudentj=student}i}rewind(fp)for(i=i<ki)fwrite(studenti,sizeof(structperson),,fp)}fclose(fp)}显示学生记录由于记录显示操作经常进行所以我将这分由独立的函数来实现减少代码的重复。Listall(){FILE*fpcharchstructpersonstudentintiintkfp=fopen("jietxt","r")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()}else{do{rewind(fp)printf("nametttnumtchinesettEnglishttmathtsumtaveragen")while(fread(student,sizeof(structperson),,fp)){printf("sldfffffn",studentname,studentnum,studentchinese,studentEnglish,studentmath,studentsum,studentaverage)}printf("GOON(YN)n")ch=getchar()getchar()}while(ch=='y'||ch=='Y')}fclose(fp)returnconfirm()}四、具体程序的实现#include"stdioh"#include"stringh"#include"stdlibh"#include"ctypeh"structperson{charnamelongnumfloatmathfloatEnglishfloatchinesefloataveragefloatsum}studentintN=Enter(){FILE*fpcharchcharchcharnumstrstructpersonstudentclrscr()fp=fopen("jietxt","ab")if(fp==){printf("can'topenthisfilen")printf("waitforasecondwithpatiencenthesystemisexitingn")getch()exit()

职业精品

精彩专题

上传我的资料

热门资料

资料评价:

/ 31
所需积分:2 立即下载

意见
反馈

返回
顶部

Q