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

加入VIP,免费下载
 

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

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

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(学生宿舍管理系统.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

学生宿舍管理系统.docx

1、学生宿舍管理系统目 录前言 C语言程序综合设计任务书-21.0任务书-32.7小型学生成绩管理系统-42.1总体设计-4 2.2模块划分-42.3算法说明-42.4各函数模块功能及流程图-42.5程序测试-72.6结论-72.7原程序清单-73.0体会及建议-154.0参考文献-15C语言程序综合设计任务书(设计性实验)一. 实验目的 1、 进一步掌握计算机程序设计基础基本概念,理解其原理与方法。2、 进一步理解和巩固所学的理论知识,掌握高级语言程序设计的编程技巧。3、 培养分析解决实际问题的能力,培养进行高级语言程序设计的实际编程能力。二. 实验任务用语言设计一个综合应用程序。主要设计内容有

2、数据库管理程序设计、图形设计、科学计算程序设计、简单游戏程序设计等。 学生可以结合自己的专业及兴趣爱好自由命题,也可以从已给几类题目中任选一题,下面题目只是基本要求,鼓励同学自主创新、自由发挥。三. 实验要求 1. 要求学生自主完成以下工作:1) 查阅资料,选定题目。2)制定方案,进行程序总体设计和详细设计。3)程序详细设计,调试,运行。4)撰写设计报告。2. 实验报告内容包括:封面、实验目的、实验内容、设计方案制定、总体设计、详细设计、源程序清单(要求有详细注释)、总结与体会。一、任务书2.7学生宿舍管理系统设计功能:实现简单的学生宿舍基本信息管理,宿舍的基本信息包括楼号、房间号、面积、所容

3、纳人数、已入住人数等基本要求: 1 设计简单的菜单,能够进行系统功能选择。2 实现信息的录入功能。3 在已有信息的基础上添加新的记录。4 删除指定房间号的记录。5 修改指定房间号的记录6 实现信息的浏览功能7 按房间号查询功能8 按已入住人数排序功能相关知识: 结构体、数组、常用算法(排序、查找、删除)扩充功能:1)在数据维护(录入、删除、修改、添加)功能时,要求输入用户名和密码,以防信息被非法修改。 提示:在主菜单界面中,将录入、删除、修改、添加功能合并为数据库维护功能,当选择此选项时,要求用户输入用户名和密码,如设数据库维护人员为2人,则在程序中可相应设置2个用户名和密码,只有正确时,才进

4、入下一级维护菜单。(密码设置参阅字符串操作部分) 2)增加查询方式,如可以根据房间号查询,根据书名查询,及多种排序方式 提示:在查询或排序中加入分支程序,不同的分支采用不同的查询方式,每种查询方式是一个独立的模块(函数)3)将数据信息以文件的形式存盘,数据库信息的各种操作最后都能被存储,存储前有提示,并且能打开。 提示:在主菜单中增加文件打开、存储选项,C语言的文件操作都是通过库函数实现的,参考关于文件的库函数使用即可。 4)采用动态链表的方式进行设计。提示:要求了解链表的建立、插入、删除原理,掌握C语言的动态内存分配函数的应用。链表编程可参考苏小红编语言大学实用教程314325第8.5节动态

5、数据结构和362374的例子。二、学生宿舍管理系统设计1、总体设计 实现简单的学生宿舍基本信息管理 用动态链表、结构体等相关知识完成如下内容:1)、简单菜单界面,按16键选择选项2)、实现各个函数的功能2、模块划分主模块:main()/*主函数*/其它模块:Student *load()/*从文件中读数据建立链表*/save()/*将修改后的链表中的信息存进文件中*/Add_student()/*添加学生信息*/del_stu()/*按学号删除学生信息*/find_student()/*按学号查找学生信息*/ame_student()/*修改学生信息*/print_student()/*输出学

6、生信息*/3、算法说明 Step 1 输出主菜单 Step 2 按16键选择 Step 3 实现各个函数的功能4、各函数功能及流程图main()/*主函数*/Student *load()/*从文件中读数据建立链表*/save()/*将修改后的链表中的信息存进文件中*/Add_student()/*添加学生信息*/del_stu()/*按学号删除学生信息*/find_student()/*按学号查找学生信息*/ame_student()/*修改学生信息*/print_student()/*输出学生信息*/流程图如下: 欢迎进入学生宿舍管理系统 打印 1 添加学生信息 2删除学生信息 3查找学生

7、信息 4修改学生信息 5输出学生信息 6退出程序 请输入1-6,其他输入非法!1 2真p=head,q=stud1,q1 链表是空表链表是空表 假 将 所指的结点作为唯一结点当num!=p-num以及p所指的结点不是表尾结点输出空表是 否 p=head打印:1:修改房间号2:修改楼号3:修改面积 4:修改所容纳人数5:修改已入住人数请输入1-5其它非法!真输出无该学生信息退出程序无学生信息打印输入修改的已入住人数,修改打印输入修改的所容纳人数,修改打印输入修改的面积,修改打印输入修改的;楼号,修改4p-stu_num!=stu_num打印输入修改的房间号,复制23516p-stu_num=st

8、u_num输出无该学生信息输出无该学生信息输出学生信息输出不存在学生信息p-stu_num!=stu_nump-stu_num=stu_num循环输出学生信息链表是一个空表假假假真真链表是一个空表5head=q q-next=p(插到表头之前)是假真q否p=qp=p-next(p后移一个位置) 5、程序测试 (1)静态检查; (2)静态检查无误后,上机调试; (3)改正语法错误;运行。 检查错误方法:(1) 将程序与流程图仔细对照,如果流程图正确,程序写错了,错误很容易发现;(2) 采取“分断检查”的方法,不断缩小检查区,就可能发现错误所在。6、结论: 此程序可以在TC中正常、正确运行。实现学

9、生宿舍成绩管理。7、原程序清单程序原代码#include #include #include #include typedef struct student_info char flour_num; int room_num; int area; int contain_people; int reside_people; struct student_info *next;Student;Student *head;Student *load() FILE *fp; Student *head_1,*p,*q; head_1=NULL; fp=fopen(student,rb); if(fp

10、=NULL) fp=fopen(student,wb);fclose(fp);return head_1; p=(Student*)malloc(sizeof(Student); if(fread(p,sizeof(Student),1,fp)!=1)return head_1; head_1=p; while(!feof(fp) q=p; p=(Student*)malloc(sizeof(Student); fread(p,sizeof(Student),1,fp); q-next=p; q-next=NULL; free(p); fclose(fp); return head_1;int

11、 save() FILE *fp; fp=fopen(student,wb); while(head!=NULL) fwrite(head,sizeof(Student),1,fp); head=head-next; fclose(fp); return 0;int Add_student()Student *p,*q;Student *stud1;char flag=y;stud1=(Student*)malloc(sizeof(Student);while(flag=y|flag=Y) q=p=head; printf(Please enter Canada to fill the stu

12、dent information:n); printf(flour_num room_num area contain_people reside_peoplen); scanf(%d %d %d %d %d,&stud1-flour_num,&stud1-room_num,&stud1-area,&stud1-contain_people,&stud1-reside_people); stud1-next=NULL; fflush(stdin); if(head=NULL)head=stud1; else while(p-room_numroom_num&p-next!=NULL) q=p;

13、p=p-next; if(p-room_numstud1-room_num) if(p=head)stud1-next=head;head=stud1; else q-next=stud1;stud1-next=p; else p-next=stud1; stud1=(Student*)malloc(sizeof(Student); printf( add end,whether or not to continue to add,y or Y to continue ,otherwise exit :n); flag=getchar(); fflush(stdin); free(stud1)

14、; system(cls); return 0;int del_stu() Student *p,*q; int room_num; char flag=y; int tage=0; while(flag=y|flag=Y) p=head; q=NULL; printf(ninput the delete room number!n); scanf(%d,&room_num); if(head=NULL) printf(There is no student informationn);return 0; while(p!=NULL) if(p-room_num=room_num) tage=

15、1; if(p=head)head=head-next; else q-next=p-next; free(p);break; q=p;p=p-next; if(tage=0) printf(To delete the student information does not existn); tage=0; printf(To delete the end, whether or not to continue the operation to remove: y or Y to continue, not to endn); fflush(stdin); scanf(%c,&flag);

16、system(cls); return 0;int find_student() Student *p; char flag=y; int room_num; int tage=0; while(flag=y|flag=Y) printf(input the finding room number!n); scanf(%d,&room_num); p=head; if(head=NULL)printf(There is no student information!n);return 0; else while(p!=NULL) if(p-room_num=room_num) tage=1;

17、printf(You have to find the information students are as follows:n); printf(%dt%dt%dt%dt%dn,p-flour_num,p-room_num,p-area,p-contain_people,p-reside_people); break; else p=p-next; if(tage=0)printf(No information on the studentsn); tage=0; printf(Find the end, whether or not to continue the operation t

18、o find: y to continue or Y, who has quit!n); fflush(stdin); scanf(%c,&flag); return 0;int ame_student() Student *p; int room_num; int tage=0; int chiose; char flag=y; printf(input the change room number!n); scanf(%d,&room_num); p=head; while(flag=y|flag=Y) if(head=NULL)printf(Students there is no in

19、formation!n);return 0; while(p!=NULL) if(p-room_num=room_num) tage=1; printf(Requested to amend the electoral code!n); printf(1:n); printf(2:n); printf(3:correct the arean); printf(4:n); printf(5:n); printf(please enter 1-5!else illegal!n); scanf(%d,&chiose); switch(chiose) case 1:char flour_num; pr

20、intf(Please enter the flour number changes!n); scanf(%d,&flour_num); p-flour_num=flour_num; break; case 2:int room_num; printf(Please enter the room number changes!n); scanf(%d,&room_num); p-room_num=room_num; break; case 3:int area; printf(Please enter the area!n); scanf(%d,&area); p-area=area; bre

21、ak; case 4: int contain_people; printf(Please enter the contain_people!n); scanf(%d,&contain_people); p-contain_people=contain_people; break; case 5: int reside_people; printf(Please enter the reside_people!n); scanf(%d,&reside_people); p-reside_people=reside_people; break; default: printf(There is

22、no such operation!n);break; break; else p=p-next; if(tage=0)printf(No information on the students!n); tage=0; printf(The end of the revision, whether to modify the operation of student information: y to continue or Y, who has quit!n); fflush(stdin); scanf(%c,&flag); fflush(stdin); system(cls); retur

23、n 0;int print_student() Student *p; p=head; if(head=NULL)printf(No information on the students!n);return 0; printf(flour numbertRoom numbertareatcontain peopletreside peplen); printf(=n); while(p!=NULL) printf(%dt%dt%dt%dt%dn,p-flour_num,p-room_num,p-area,p-contain_people,p-reside_people); p=p-next;

24、 printf(=n); printf(The end of the output!n); return 0;int main() int tage; head=load(); while(1) printf(Welcome to the Student Management System!n); printf( 1: Add student information n); printf( 2: Delete student information n); printf( 3: Students looking for information n); printf( 4: Amend the Student Informationn); printf( 5: Output of information s

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1