学生信息管理系统课程设计实验报告_第1页
学生信息管理系统课程设计实验报告_第2页
学生信息管理系统课程设计实验报告_第3页
学生信息管理系统课程设计实验报告_第4页
学生信息管理系统课程设计实验报告_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

*大学课 程 设 计 报 告 课程名称 高级语言程序设计 设计题目 学生信息管理系统 专 业 计算机科学与技术 班 级 学 号 姓 名 完成日期 课 程 设 计 任 务 书设计题目: 学生信息管理系统设计 设计内容与要求:内容:对学生信息进行管理,学生信息包括学号、姓名、性别、年龄、学历、学号、住址、电话等(学号不重复)。要求:(1)系统以菜单方式工作(2)学生信息录入功能(学生信息用文件保存) 。(3)输出学生信息、浏览学生信息功能。(4)查询和排序功能:(至少一种查询方式) ,如按学号查询、按学历查询等。(5)学生信息删除、修改功能(任选项)。 指导教师:_ 年 月 日课 程 设 计 评 语 成绩: 指导教师:_ 年 月 日党的基层组织建设有了新突破,党的作风建设有了新加强,为全镇发展经济、提高人民生活永平提供了坚实基础和强大动力carried out; 4) for spring hangers (included simple spring, hangers and constant support hangers) it should also be recognized as setting and locking of loads. 5) check the surface quality, folded layering and without cracks, rust and other defects. 5) after completion of the test and control drawing number one by one, by series baled. Color alloy steel parts, the parts marking installation location and rotation about the direction you want. 7.3.14. hangers installation 7.3.14.1 hanger layout a. a clear design of hanger should be installed strictly in accordance with the drawings and designs shall not be installed wrong, missing, etc. B. own arrangement of piping support and hanger set and selection should be based on comprehensive analysis of general layout of piping systems; cold installation of steam pipe with particular attention reserved for compensation of thermal expansion displacement and orientation. C. support systems should be rational to withstand pipe loads, static load and incidental load; reasonable piping displacement; guaranteed under various conditions, stress are within the allowed range. Strength, stiffness, and meet requirements to prevent vibration and soothing water, without affecting the adjacent equipment maintenance and other piping installation and expansion. D. equipment connected to the interface to meet pipeline thrust (torque) limit requirements; increase the stability of piping systems to prevent pipeline . C. welding elbow should be not less than 1.5 times the pipe diameter. D. Press elbow should be not smaller than the outside diameter of the pipe.洛 阳 理 工 学 院 课 程 设 计 报 告【问题描述】 学生信息管理软件设计。对学生信息进行管理,学生信息包括:学号,姓名,年龄,性别,出生年月,地址,电话,E-mail等。试设计一个学生信息管理软件。【基本要求】一、输入的形式和输入值的范围形式:用scanf输入学生的学号,姓名,年龄,性别,出生年月,地址,电话,E-mail。输入一个学生信息一个回车。用输入的学号p1-num来控制输入,当输入的学号为0时,用break跳出循环。即if(p1-num=0)break。输入值的范围:学号、年龄为整型 long num; int age; 姓名为字符串型15个字节char name15; 性别为字符串型,10个字节char sex10; 出生为字符串型,20个字节char chushen20; 地址为字符串型,30个字节char dizhi30;邮箱为字符串型,输入11位数字char email11。二、输出的形式输出是以表格的形式输出,即表格的每一行都能显示第一个学生的信息,第二行是显示第二个学生的信息。三、程序所能达到的功能对学生信息进行管理,学生信息包括职学号,姓名,年龄,性别,出生年月,地址,电话,E-mail。(1)系统以菜单方式工作(2)学生信息录入功能。(3)输出学生信息、浏览学生信息功能。(4)查询和排序功能:(至少一种查询方式),如按学号查询、按姓名查询等。(5)学生信息删除、修改功能(任选项)。(6)添加学生信息。【测试数据】输入:设输入四个学生信息,以最后一个学生的学号为0来结束输入,学号是整型。预期的输出结果:预期的输出结果请参见程序后的运行结果。【数据结构】排序记录的数据元素表采用一维数组存储结构,每个元素包含8个关键字段,其类型描述为:#include #include /分配size字节的存储区#include /包含字符串处理函数的头文件,可以直接调用现有的字符串处理的一系列函数#define len sizeof(struct student) /宏定义求字节运算符#include /清屏功能struct student /声明一个结构体类型struct student long num; /定义学号为long型数据 char name15; /定义姓名int age; /定义年龄 char sex3; /定义性别char chushen10; /定义出生char dizhi20; /定义出生地址char phone11; /定义电话char email20; /定义邮箱 struct student *next; /next是指针变量,指向结构体变量【算法思想】利用一维结构体存放所有学生的信息,输入后,在输出时要对学生按学号的高低排序,然后可以执行按学号查询学生信息,输入学号,删除学生信息,输入学号可以找出该学生信息,然后选择修改学生信息,如果来了新学生,还可以添加学生信息。【总体设计】输入一个学生学号,来删除该学生信息输入学号,修改的学生信息显示主菜单输入函数学生排序输出学生信息删除学生信息修改学生信息添加学生信息用键盘输入学生信息按学生学号高低排序在原有的学生上添加学生信息以表格的形式输出学生信息主菜单包括:输入函数、学号排序、浏览函数、删除函数、修改函数、添加函数。 图1-1学生管理总体设计【模块划分】一、主函数:main()显示系统工作菜单,显示该系统的所有功能。告诉使用者所有将会调用的被调函数,再运用选择函数switch即可根据使用者所输入的学号进入对应的功能程序。并且对菜单做了一个循环,进行完一个选择后,按回车键可进行清屏功能,把屏幕上除了主菜单以外都清空,然后可以继续选择那些可以使用的功能,这样可以方便使用者使用,并且每一步都很清晰。以8退出系统。 二、输入函数:struct student *creat()在该程序的前面已经定义了一个结构体struct student用来储存学生的所有信息,(学号、年龄、姓名、性别、出生日期、地址、电话、邮箱)。定义p1和p2,struct student *p1,*p2;p1,p2是指向struct student类型数据的指针变量。定义一个n=0,n是输入的个数,主要作用是:如果输入一个学生信息,首地址指向p1,head=p1;否则p2的下一个地址指向p1,p2指向p1. p2-next=p1;p2=p1;学号控制循环。三、排序函数:void paixu(struct student *head)用一个for语句做循环,不是NULL的话,指针指向下一个,按学生学号高低排序。整形直接交换,字符型用strcpy交换,类型相当于两个数据之间的交换。四、输出函数:void printlist(struct student *head) 在主函数里边用while控制循环,输出学生信息,然后指针指向下一个。5、 查询函数:void findList_num(struct student *head) 和void findList_num(struct student *head)输入一个学号或姓名,做一个for循环,即指针pt指向第一个地址,再定义一个指针p1,让它等于pt,他是紧跟着pt后面的一个指针,让p1-next不等于NULL,pt指向下一个地址。这样就能修改最后一个学生信息了。如果要查询的学生的学号在学生里,就输出该学生信息,否则,就输出查询的学生信息不存在。六、删除函数:int shanchu(struct student *head)输入一个学号,先找到这个学生的信息。如果输入的学号在学生信息中,就进行以下循环:如果输入的是第一个学生的话,就head等于第二个学生信息;如果输入的学生信息是最后一个,就让倒数第二个等于NULL;否则的话,就让下一个学生信息覆盖前一个。如果输入的学号不在学生信息中,输出“此学生信息不存在”。七、修改函数:struct student *delList(struct student *head,long del_num)输入要修改的学号,找到该学生并且输出该学生的信息。然后屏幕上会出现学生信息的所有项目,用switch进行选择修改的项目。选择后输入新的学生信息,用它来覆盖原来的学生信息。八、添加函数:void insert(struct student *head) 用一个while语句while(p2-next!=NULL)控制循环,p2的指针指向下一个地址,即p2=p2-next;这是找到最后一个地址,然后开辟动态存储区,p1=(struct student *)malloc(len);输入要添加的学号,用学号为0来终止循环,如果不为0,就继续输入学生信息。【源程序】#include #include /分配size字节的存储区#include /包含字符串处理函数的头文件,可以直接调用现有的字符串处理的一系列函数#define len sizeof(struct student) /求字节运算符#include /清屏功能FILE *fp;struct student /声明一个结构体类型struct studentint num; /学号为整型 char name20; /姓名为字符串 char genter10; /性别为字符串 int age; /年龄为整型 char xueli20; /学历为字符串 int gongzi; /学号为整型 char address30; /地址为字符串 char phone11; /电话为字符串 struct student *next; /next是指针变量,指向结构体变量;void menu() printf(=学生信息管理系统=nn); printf( 1、录入学生信息n); printf( 2、浏览学生信息n); printf( 3、查询学生信息n); printf( 4、删除学生信息n);printf( 5、插入学生信息n); printf( 6、修改学生信息n);printf( 7、排序学生信息n);printf( 8、退出管理系统n); printf(=n);struct student *creat() /录入学生信息int n;struct student *head; struct student *p1,*p2;n=0; p1=p2=(struct student *) malloc(len); scanf(%dt%dt%st%st%st%st%st%s,&p1-num,&p1-age,p1-name,p1-sex,p1-chushen,p1-dizhi,p1-phone,p1-email); head=NULL; while(p1-num!=0) n=n+1;if(n=1) head=p1;else p2-next=p1;p2=p1;p1=(struct student *)malloc(len);scanf(%dt%dt%st%st%st%st%st%s,&p1-num,&p1-age,p1-name,p1-sex,p1-chushen,p1-dizhi,p1-phone,p1-email); p2-next=NULL; return(head);void insert(struct student *head) /插入学生信息 int search_num; struct student *p,*q,*s; p=head; printf(在哪个学生前插入 请输入学号:n); scanf(%d,&search_num); while(p!=NULL)&(p-num!=search_num) q=p; p=p-next; s=(struct student *)malloc(len); q-next=s; system(cls); printf(请输入学生信息:n); printf(学号t年龄t姓名t性别t出生t地址t电话te-mailn); scanf(%dt%dt%st%st%st%st%st%s,&s-num,&s-age,s-name,s-sex,s-chushen,s-dizhi,s-phone,s-email);s-next=p;void printList(struct student *head) /浏览全部学生信息 struct student *p; p=head; if(head=NULL) printf(没有学生信息!n); else do fread(p,len,1,fp); printf(%dt%dt%st%st%st%st%st%sn,p-num,p-age,p-name,p-sex,p-chushen,p-dizhi,p-phone,p-email); p=p-next; while(p!=NULL); void findList_num(struct student *head,long search_num) /按学号查找 struct student *p; p=head; while(p!=NULL)&(p-num!=search_num) p=p-next; if(p!=NULL) printf(%dt%dt%st%st%st%st%st%sn,p-num,p-age,p-name,p-sex,p-chushen,p-dizhi,p-phone,p-email); else printf(没有该学生信息!n);void findList_name(struct student *head,char *search_name) /按姓名查找 struct student *p; int cmp1=0,cmp=0; p=head; while(p!=NULL) if(strcmp(p-name,search_name)!=0) p=p-next; cmp+; else printf(%dt%dt%st%st%st%st%st%sn,p-num,p-age,p-name,p-sex,p-chushen,p-dizhi,p-phone,p-email); p=p-next; cmp1=1; if(cmp!=0&cmp1=0) printf(没有该学生信息!n); void xiugai(struct student *p1,long xiu_num) /修改学生信息struct student *p2;p2=p1;while(p2!=NULL)&(p2-num!=xiu_num)p2=p2-next; if(p2!=NULL)scanf(%dt%dt%st%st%st%st%st%s,&p2-num,&p2-age,p2-name,p2-sex,p2-chushen,p2-dizhi,p2-phone,p2-email);else printf(没有该学生信息!n); struct student *delList(struct student *head,long del_num) / 删除学生信息 struct student *p,*q; p=head; q=head; while(p &(p-num != del_num) q=p; p=p-next; if(p=NULL) printf(无此学号!n); else if(p = head) head = p-next; free(p); else q-next = p-next; free(p); return head;void paixu(struct student *head) /按学号排序struct student *p,*f,*t;char ch100;int i;t=f=p=head;for(p=head;p-next!=NULL;p=p-next)for(t=head,f=t-next;t-next!=NULL;t=t-next,f=f-next)if(t-numf-num0)i=t-num;t-num=f-num;f-num=i;i=t-age;t-age=f-age;f-age=i;strcpy(ch,t-name);strcpy(t-name,f-name);strcpy(f-name,ch);strcpy(ch,t-sex);strcpy(t-sex,f-sex);strcpy(f-sex,ch);strcpy(ch,t-chushen);strcpy(t-chushen,f-chushen);strcpy(f-chushen,ch);strcpy(ch,t-dizhi);strcpy(t-dizhi,f-dizhi);strcpy(f-dizhi,ch);strcpy(ch,t-phone);strcpy(t-phone,f-phone);strcpy(f-phone,ch);strcpy(ch,t-email);strcpy(t-email,f-email);strcpy(f-email,ch);/return head;void save(struct student *head) /保存为磁盘文件struct student *p;if(fp=fopen(keshe,w)=NULL) /打开一个文件printf(cannot open this filen);exit(0);p=head;while(p!=NULL)fprintf(fp,%dn,p-num);fprintf(fp,%dn,p-age);fprintf(fp,%sn,p-name);fprintf(fp,%sn,p-sex);fprintf(fp,%sn,p-chushen);fprintf(fp,%sn,p-dizhi);fprintf(fp,%sn,p-phone);fprintf(fp,%sn,p-email);p=p-next;fclose(fp);struct student *read() /从磁盘读取文件struct student *head=NULL;struct student *p=NULL;struct student *t=NULL;int a;/fp=fopen(keshe,r);if(fp=fopen(keshe,r)=NULL) /打开一个文件printf(cannot open this filen);exit(0);while(1)t=(struct student *)malloc(len);a=fscanf(fp,%dt%dt%st%st%st%st%st%s,&t-num,&t-age,t-name,t-sex,t-chushen,t-dizhi,t-phone,t-email);if(a=0|a=-1)return head;t-next=NULL;if(p=NULL)p=t;head=t;elsep-next=t;p=p-next;p-next=NULL;fclose(fp);void main() /主函数 int code=0; struct student *pt = NULL; for(code=1;code+) /控制循环 menu(); /调用菜单函数 printf(请输入序号:n); /提示输入序号 scanf(%d,&code);system(cls); /清屏(下边也是这样的功能) switch(code) /选择序号进行功能选择 case 1: system(cls); printf(=输入学生信息 =n); printf(-n); printf(学号t年龄t姓名t性别t出生t地址t电话te-mailn); pt=creat(); /调用输入函数 save(pt); /将数据存储到磁盘中 system(cls); printf(=输入学生信息 =n); printf(-n); printf(*成功输入学生信息*!nn); printf(按回车键返回主菜单n); getchar(); getchar(); /按回车键返回 system(cls);break;case 2: system(cls); printf(=学生信息表 =n); printf(-n); printf(学号t年龄t姓名t性别t出生t地址t电话te-mailn); printList(read(); /调用输出函数(是从磁盘中读出的) printf(= =n); printf(-n); printf(n按回车键返回主菜单n); getchar(); getchar(); system(cls);break;case 3: int search=0; system(cls); printf(=查询学生信息=n); printf(-n); while(search!=3) /进入查询功能函数 printf(1、按学号查询n2、按姓名查询n3、退出查询n); scanf(%d,&search); /插入查找的方式 switch(search) case 1: /选择学号查询 long search_num; system(cls); printf(请输入学生学号n); scanf(%d,&search_num); system(cls); printf(=查询结果=n); printf(-n); printf(学号t年龄t姓名t性别t出生t地址t电话te-mailn); findList_num(read(),search_num); /调用查找函数,将数据从磁盘中读出 printf(= =n); printf(-n); printf(n按回车键返回查询菜单n); getchar(); getchar(); system(cls);break;case 2: /按姓名查找 char search_name15; system(cls); printf(请输入学生姓名n); scanf(%s,search_name); /输入要查找的学生的姓名 system(cls); printf(=查询结果= =n); printf(-n); printf(学号t年龄t姓名t性别t出生t地址t电话te-mailn); findList_name(read(),search_name); /调用姓名查找函数 printf(=n);printf(-n); printf(n按回车键返回查询菜单n); getchar(); getchar(); system(cls); ; system(cls);break; case 4: /删除学生信息 long del_num; system(cls); printf(=删除学生信息 =n);printf(-n); printf(请输入要删除学生信息的学号:n); scanf(%d,&del_num); /输入要删除的学号 system(cls); pt=delList(read(),del_num); /调用删除函数save(pt); printf(=删除结果=n); printf(-n); printf(学号为%d的学生信息成功删除n,del_num); printf(n按回车键返回主菜单n); getchar(); getchar(); system(cls);break;case 5: /插入函数 system(cls); printf(=插入学生信息=n); printf(-n); insert(pt); /调用输入函数save(pt); /保存到磁盘中 system(cls); printf(=插入学生信息=n);printf(-n); printf(*插入学生信息成功*!nn); printf(按回车键返回主菜单n); getchar(); getchar(); system(cls);break

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论