ImageVerifierCode 换一换
格式:DOC , 页数:45 ,大小:330.54KB ,
资源ID:2727321      下载积分:14 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/2727321.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(C语言专业课程设计学生宿舍标准管理系统.doc)为本站上传会员【精***】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

C语言专业课程设计学生宿舍标准管理系统.doc

1、 程序设计工程训练汇报 学生宿舍管理系统 课程名称 程序设计工程训练 姓 名 院(系) 信息科学和技术学院 专业班级 学 号 指导老师 教务处制 目 录 1 需求分析 1 2 系统总框图和功效模块说明 2 2.1 系统总框图。 2 2.2 功效模块说明 3 2.3 程序总体框架 4 3 系统设计 10 3.1 关键结构体 10 3.2关键功效函数 10 4 调试情况 11 4

2、1输入密码进入程序 11 4.2主界面 11 4.2.1输入学生信息 11 4.2.2输出学生信息 12 4.2.3更新学生信息 12 4.2.4查询学生信息 13 4.2.5排序 13 4.2.6统计学生信息 14 5 设计总结 14 6 源程序清单 15 1 需求分析 输入正确密码后进入系统,用read_message()函数先读取文件内容,再在do while循环中用switch语句进行选择(选一进入输入模块;选二进入输出模块;选三进入更新模块,在更新模块中又包含了三个小模块:删除,修改,插入;选四进入查询模块,在查询模块中能够依据信息中学号,姓名

3、宿舍,楼层,楼号来进行查询;选五进入排序模块,在排序模块中能够依据学号,宿舍,楼层,楼号进行排序;选六进入统计模块,能够依据宿舍,楼层,楼号进行统计。)退出程序时,对信息进行保留,方便下次调用。 2 系统总框图和功效模块说明 2.1 系统总框图 1.输入函数(input_message()) 2.输出函数(output_message()) 3.读函数(read_message()) a).删除函数(del_message()) 4.更新模块 b).修改函数(revise_message())

4、 c)插入函数(insert_message()) a).按姓名查询(inquire_name()) 主 函 数 5.查询模块 b).按学号查询(inquire_num()) c).按宿舍查询(inquire_dormitary()) d).按楼层查询(inquire_floor()) e).按宿舍楼查询(inquire_building()) 6.排序模块 a).按学号排序(sort_num()) b).

5、按宿舍排序(sort_dormitary()) c).按楼层排序(sort_floor()) d).按宿舍楼排序(sort_building()) 7.统计模块 a).按学号统计(count_num()) b).按楼层统计(count_floor()) c).按楼号统计(count_building()) 8.保留信息(save_message()) 9.退 出 2.2 功效模块说明 1.输入函数:用来录入数据和

6、相关信息。 2.输出函数:用来输出录入相关信息。 3. 读函数:将文件中数据读入。 4.更新模块:对以存信息进行更新.有以下多个选项: (1)删除函数:用来删除已离校学生信息。 (2)修改函数:用来修改改变宿舍学生信息。 (3)插入函数:用来插入新同学宿舍信息。 5.查询模块:输入一项信息,能够得到存入整条信息,具体有以下: (1)按姓名查询:输入学生姓名,可得到整条学生信息。 (2)按学号查询:输入学生学号,可得到整条学生信息。 (3)按宿舍查询:输入宿舍号,可得到全部住在该宿舍号中学生全部信息。 (4)按楼层查询:输入楼层数后,可得到全部住在该

7、层学生信息。 (5)按宿舍楼查询:输入宿舍楼数,可得到全部住在该楼学生信息。 6.排序模块:用来对录入信息进行整理,使其排列有规律性。 (1) 按学号排序:把输入学号从小到大进行排序 。 (2) 按宿舍排序:把输入宿舍从小到大进行排序 。 (3) 按楼层排序:把输入楼层从小到大进行排序 。 (4) 按宿舍楼排序:把输入宿舍楼从小到大进行排序 。 7.统计模块:用来把录入信息进行统计,使使用者清楚明了。 (1) 按宿舍统计:输入要统计宿舍号,把这个宿舍里全部组员输出,并显示在这个宿舍里总人数。 (2) 按楼层统计:输入要统计楼层,把全部住在这个楼层上学生信息输出,

8、并显示总人数。 (3) 按楼号统计:输入要统计楼号,把全部住在该楼学生信息输出,并显示总人数。 8.保留信息:对信息进行保留,使下次打开时还存在。 9.退出系统。 2.3 程序总体框架 主函数步骤图: 开始 N 输入密码 Y 读函数 输入choice 进入输入模块 Choice 1 Y 进入输出模块 Choice 2 N Y N 进入更新模块 Choice 3

9、 Y N 进入查询模块 Choice 4 Y N 进入排序模块 Choice 5 读函数 Y 进入统计模块 Choice 6 N Y N 退出 Choice 0 Y 保留函数 结束 修改模块步骤图: 开始 输入学号 输入choice choice=1? 输入修改后num

10、 是 否 输入修改后name choice=2? 是 否 输入修改后sex choice=3? 是 否 输入修改后age choice=4? 是 否 输入修改后major choice=5? 是 Choice=6? 输入修改后grade

11、 否 是 否 是Choice=7? 输入修改后class 否 是 Choice=8? 输入修改后building 否 输入修改后floor 是Choice=9?

12、 否 Choice=10? 输入修改后dormiatry 是 输出修改后信息 结束 查询模块步骤图: 开始 输入choice Inquire_name choice=1? 是 否 Inquire_num choice=2? 是 否 是 Inquire_dormitary choice=3? 否 Inquire_floor

13、 choice=4? 是 否 choice=5? Inquire_building 是 否 choice=0? 是 结束 更新模块步骤图: 开始 输入choice output_message(h) del_message(h) choice=1?

14、 是 否 output_message(h) revise_message() choice=2? 是 否 是 output_message(h) insert_message(h); choice=3? choice=0? 是 结束 删除模块步骤图: 开始

15、 输入num p0=h p=p0->next p->num==num p0->next=p->next; free(p); 是 否 p0=p; p=p->next; p=p->next; 结束 否 按姓名查询步骤图: 开始 输入name p0=h strcmp(p0->name

16、name)?==0 是 输出p0 否 p0=p0->next 结束 (按学号、宿舍号、楼层、宿舍楼步骤图类似于按姓名查询步骤图) 排序模块步骤图: 开始 输入choice output

17、 (h) sort_num() choice=1? 是 否 output (h) sort_dormitary() choice=2? 是 否 是 choice=3? sort_floor() output (h) 否 choice=4? sort_building() output (h) 是

18、 否 choice=0? 是 结束 统计模块步骤图: 开始 输入choice count_dormitary() choice=1? 是 否 count_floor() choice=2? 是 否 是 count_buil

19、ding() choice=3? choice=0? 是 结束 3 系统设计 3.1 关键结构体 struct stud { int num; char name[10]; char sex[8]; int age; char major[18]; int grade; int classes; int bu

20、ilding; int floor; int dormitary; struct stud *next; }; 3.2关键功效函数 input_message()/*输入模块*/ read_message()/*读取信息*/ output_message(struct stud *p)/*输出模块*/ del_message(struct stud *h)/*删除学生信息*/ revise_message()/*修改学生信息*/ insert_message(struct stud *h)/*插入学生信息*/ renew_message()/*

21、更新模块*/ inquire_name()/*按姓名查询*/ inquire_num()/*按学号查询*/ inquire_dormitary()/*按宿舍号查询*/ inquire_floor()/*按楼层查询*/ inquire_building()/*按宿舍楼查询*/ inquire_message()/*查询模块*/ sort_num()/*按学号排序*/ sort_dormitary()/*按宿舍排序*/ sort_floor()/*按楼层排序*/ sort_building()/*按宿舍楼排序*/ output(struct stud *p)/*用于输出排序模

22、块*/ sort_message()/*排序模块*/ count_floor()/*按楼层统计*/ count_building()/*按宿舍楼统计*/ count_message()/*统计模块*/ save_message(struct stud *h)/*保留信息*/ 4 调试情况 4.1输入密码进入程序 4.2主界面 4.2.1输入学生信息 4.2.1.1输入一共有多少个学生信息 4.2.1.2完成一个学生信息登记 4.2.2输出学生信息 4.2.3更新学生信息 可图:(修改王安

23、性别) 4.2.4查询学生信息 可图:(按宿舍楼查询) 4.2.5排序 4.2.6统计学生信息 图:(按楼层统计) 该程序中可能还存在部分小问题,比如有时候它会主动清屏,有时候不会。而且我在编译过程中发觉自己存在好多毛病,有粗心了等,不注意细节,其实自己也知道细节决定成败,以后我会注意。 5 设计总结 经过两周编程,我完成了学生宿舍管理这个小系统。深入了解并掌握了C 语言中精华指针和键表。程序能够流畅运行,实现对数据录入、修改、插入、删除、排序、查询、统计等基础功效。程序开始时从文件中读取数据,结束时对新数据或更新数据进

24、行保留,方便下次再次调用。 在编程中也不是一帆风顺,开始时因为对C语言很多知识点全部遗忘了,造成编程过程中相当吃力,经过一两天适应后,模块基础上编得心应手。但当我编写读数据这个模块时碰到了一点问题,程序总是读出部分乱码,并不是我先前存入数据。经过指导老师耐心指点下,最终处理了这个问题。 这次高级语言程序设计,不仅巩固了我所学到C语言知识,还让我认识到了编写一个完整程序不仅要有必备基础知识,还要耐心,细心,碰到问题不能轻言放弃,灵感可能就会出现在下一秒。 课程设计是把我们所学理论知识进行系统总结并应用于实践良好机会,有利于加强我们用知识理论来分析实际问题能力,进而加强了我们

25、对知识认识实践度,巩固了我们理论知识,深化了对知识认识,并为走向社会打下一个良好基础。 在这次课程设计中我碰到很多问题和麻烦,得到了老师帮助和指导,才能够使得这次课程设计顺利进行下去,另外,在程序调试过程中,也得到很多同学帮助,给我立即指犯错误,提出很多宝贵意见。在此对老师和同学们表示感谢! 6 源程序清单 #include #include #include #define N sizeof(struct stud) /*先用结构体定义学生信息*/ struct stud { int

26、 num; char name[10]; char sex[8]; int age; char major[18]; int grade; int classes; int building; int floor; int dormitary; struct stud *next; /*next是指向本结构体类型指针类型*/ }; struct stud *h,*p; /*定义指向结构体指针变量*/ FILE *fp; /*

27、定义文件指针*/ /*建立和输出链表*/ struct stud *creat(void) { struct stud *p1,*p2,*head; int i,k; printf("Please input the total number of students:\n"); scanf("%d",&k); head=NULL; printf("Please input the message of the student:\n\n"); if(k>0) { head=p2=p1=(struct stud*)

28、malloc(N); /*为head,p2,p1申请存放空间,并全部指向首结点*/ for(i=1;i<=k;i++) { p1=(struct stud*)malloc(N); printf("Please input the number of the student:\n"); scanf("%d",&p1->num); printf("Input the name:\n"); scanf("%s",p1->name); printf("Input the sex

29、man or female):\n"); scanf("%s",p1->sex); printf("Input the age:\n"); scanf("%d",&p1->age); printf("Input the major:\n"); scanf("%s",p1->major); printf("Please input the grade and class:\n"); scanf("%d%d",&p1->grade,&p1->classes);

30、 printf("Please input the building floor and dormitary:\n"); scanf("%d%d%d",&p1->building,&p1->floor,&p1->dormitary); p2->next=p1; /*将新结点连到表尾*/ p2=p1; /*p2指向新表尾*/ } p2->next=NULL; head=h

31、ead->next; } save_message(head); /*将输入数据存入文件*/ return head; } /*输入模块*/ input_message() { char v; system("cls"); h=creat(); fflush(stdin); printf("\n\n\n\n\ press any key to the main meue!!!!\n"); v=getchar(); re

32、turn; } /*读取信息*/ read_message() { struct stud *p1,*p2; h=p1=(struct stud*)malloc(N); /*为了p1申请存放空间,并指向首结点*/ if((fp=fopen("gx1.txt","rb"))==NULL) { printf("\n\n\n There is no data for the monent!\n"); return; } if(fread(p1,N,1,fp)!=1) return; /

33、先向p1读入一个数据,若不能读,返回*/ while(1) { p2=(struct stud*)malloc(N); /*为了p2申请存放空间*/ if(fread(p2,N,1,fp)!=1) break; p1->next=p2; p1=p2; } fclose(fp); return; } /*输出模块*/ output_message(struct stud *p) { char v; p=h; system("cls"); if(p==NUL

34、L) printf("\n\n\n\n\n There is no datas right now!\n"); printf("number name sex age major grade class building floor dormitary\n\n"); while(p!=NULL) { printf("%6d%7s%7s%6d%8s%8d%8d%10d%7d%11d\n",p->num,p->name,p->sex,p->age,p->major,p->grade,p->clas

35、ses,p->building,p->floor,p->dormitary); p=p->next; } fflush(stdin); printf("\n\n\n\n\ press any key to the main meue!!!!\n"); v=getchar(); return; } /*删除学生信息*/ del_message(struct stud *h) { int num; struct stud *p,*p0; system("cls"); if(h==NULL) r

36、eturn 0; printf("\n\n Please input the number who you what to delete?\n"); scanf("%d",&num); p0=h; if(p0->num==num) { h=p0->next; free(p0); /*若首结点是所要删除数据,则释放首结点*/ return 1; } p=p0->next; while(p!=NULL) { if(p->num==nu

37、m) { p0->next=p->next; free(p); return 1; } p0=p; p=p->next; } return 0; } /*修改学生信息*/ revise_message() { int num1,choice; struct stud *p0; system("cls"); printf("\n\n Please input the number who you what to revi

38、se:\n"); scanf("%d",&num1); system("cls"); p0=h; /*将头结点赋给p0*/ do { if(p0->num==num1) { printf("\n Which you what to revise?\n"); printf("\n 1.number\n"); printf("\n 2.name\n"); printf("

39、\n 3.sex\n"); printf("\n 4.age\n"); printf("\n 5.major\n"); printf("\n 6.grade\n"); printf("\n 7.class\n"); printf("\n 8.building\n"); printf("\n 9.floor\n"); printf("\n 10.d

40、ormiatry\n"); scanf("%d",&choice); switch(choice) { case 1:printf("\n Input the new number:\n"); scanf("%d",&p0->num);break; case 2:printf("\n Input the new name:\n"); scanf("%s",p0->name);break

41、 case 3:printf("\n Input the new sex:\n"); scanf("%s",p0->sex);break; case 4:printf("\n Input the new age:\n"); scanf("%d",&p0->age);break; case 5:printf("\n Input the new major:\n");

42、 scanf("%s",p0->major);break; case 6:printf("\n Input the new grade:\n"); scanf("%d",&p0->grade);break; case 7:printf("\n Input the new class:\n"); scanf("%d",&p0->classes);break; cas

43、e 8:printf("\n Input the new building:\n"); scanf("%d",&p0->building);break; case 9:printf("\n Input the new floor:\n"); scanf("%d",&p0->floor);break; case 10:printf("\n Input the new dormitary:\n");

44、 scanf("%d",&p0->dormitary);break; } break; } else p0=p0->next; }while(p0!=NULL); } /*插入学生信息*/ insert_message(struct stud *h) { struct stud *p,*p0; p=(struct stud *)malloc(N); system("cls"); printf("Please input the num

45、ber of the student:\n"); scanf("%d",&p->num); printf("Input the name:\n"); scanf("%s",p->name); printf("Input the sex(man or female):\n"); scanf("%s",p->sex); printf("Input the age:\n"); scanf("%d",&p->age); printf("Input the major:\n"); scanf("%s",p->major);

46、printf("Please input the grade and class:\n"); scanf("%d%d",&p->grade,&p->classes); printf("Please input the building floor and dormitary:\n"); scanf("%d%d%d",&p->building,&p->floor,&p->dormitary); p->next=NULL; if(h==NULL) { h=p; return 1; } p0=h; if((p0

47、>num)>(p->num)) /*按学号次序插入*/ { p->next=h; h=p; return 1; } while((p0->next)!=NULL&&(p0->next->num)<(p->num)) p0=p0->next; if(p0->next==NULL) { p0->next=p; return 1; } else if((p0->next->num)==(p->num)) { f

48、ree(p); return 0; } p->next=p0->next; p0->next=p; return 1; } /*更新模块*/ renew_message() { int choice; do { system("cls"); printf("\n\n\n ~~~~~~~~'Renew message~~~~~~~~\n\n"); printf(" 1.Delete message\n\n");

49、 printf(" 2.Revise message\n\n"); printf(" 3.Insert message\n\n"); printf(" 0.Return the main menu\n\n"); printf(" Please choice(0-3):"); scanf("%d",&choice); switch(choice) { case 1:del_m

50、essage(h);output_message(h);break; case 2:revise_message();output_message(h);break; case 3:insert_message(h);output_message(h);break; case 0:break; } }while(choice!=0); } /*按姓名查询*/ inquire_name() { char v,name[10]; struct stud *p0; system("cls"

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服