学生证信息管理系统方案_第1页
学生证信息管理系统方案_第2页
学生证信息管理系统方案_第3页
免费预览已结束,剩余25页可下载查看

下载本文档

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

文档简介

1、1系统的意义及其功能本系统为学生证管理程序。系统任务描述:假设某校学生学生证基本信息主要包括:学号、姓名、所在系、班级等,本系统应能对这些基本信息进行管理,并要求具有以下功能:(1 )通过键盘输入某位学生的学生证信息。学生证包含的信息请参看自己的学生证;(2 )给定学号,显示某位学生的学生证信息;(3)给定某个班级的班号,显示该班所有学生的学生证信息;(4)给定某位学生的学号,修改该学生的学生证信息;2系统的功能结构图以及调用关系学生证管理程序键入某位学生的学生证信息丿1广输入学号、LJ'输入某班级的班号"J厂输入某位学生的学号rLJ1显示该生学生证信息LJ厂按学号排序或姓名

2、排序来'显示该班所有学生证信息修改该生的学生证信息jJ3系统功能详细分析学生证管理系统需要完成的功能主要有:从主函数进入各个子函数:子函数包括学生证信息的键入、查询信息的功能、修改学生证信息的功能、退出系统。具体功能如下:3.1学生证信息的键入3.2查询信息的功能查询记录的主要功能是通过不同的查询方式查询学生的信息。先是进入查询界面,再选择查询的方 式,选择后将输出该学生的信息。共分为两种: 给定某个学生的学号,显示该学生的学生证信息; 给定某个班级的班号,按学号排序来显示该班所有学生的学生证信息;按班级排序来显示该班所有学生的学生证信息;输入学号,显示该生的学生证信息开始输入班号,显

3、示该班所有学生的学生证信息3.3修改学生证信息的功能修改信息功能 修改信息的主要功 能是通过输入某位 学生的学号来修改 该生的学生证信 息。先是进入修改 界面,再输入学号, 输入后,将输出该 生的学生证信息, 再选择是否修改此 记录,选择是,则 输入修改的信息, 并保存修改。4运行界面主菜单界面生证信息驴生如主址信息3 !L1J 渝入诜:而 “23、±S5 1;1入汽意,输入格式不变!学吕姓名1 0-=l4ft221 1044G209 1F>44B1O8 1044&107 B0B00B0BF男女黒女女亠十砒02010101入圧钊白息忌自S耳S1-眉虐唱时(年201 02

4、B102131020102 18EF909090)9019冃 m 01 »1 Bl 010) 身侗讣卜吕出牛H期(年 32123-41 992 112757® 丄 ¥¥2丄3343 43<119921992199219921992月 日)2 122223909学生证键入的界面学 息有息 证重证 ±Ai 学聲叱号一于份主冃圭冃t性院费身1 珈 选: 入号 输宁- .1 - 1 bPL_ 1 1 12 2 月刃月 与341鄆 0 2 2 2 119 回20329-息T1 王男富间号期 时证日±ti A篦任意键返回王菓单:个人学生证信

5、息显示界面M M请选库愉入选丄页Ll 7 7 J : >显示班级信息的选择输出方式的界面诘输入士飪绅士a-?电子丄niil臨严一,A 器时=2010年9月±曰占份旺号=J aa-13-134 i-tiLEI 期:ivvaiTH月T 口T2t 1 2瓷月aQ- 1 1年莘» 3C Mllv±uuuy6 1- 2 a 144=罢:®日 in ri岀需奁竟饌返回上层荼甲=按学号排序显示该班所有学生的学生证信息界面选.-+-A04J童李四IN03年吁冃J. H32 i22 M 3312 311王五卫_彗¥笙年討口址抠| H;32213312321

6、3S3t 192 J=t9 jA22 曰舅衽:&健返回上层菜单:按姓名排序显示该班所有学生的学生证信息界面显示班级信息的退出界面言息息 息 证信昱证 生人艾-87号2学1的22500 3 92 2 13s s2)3) 日12日 月12月 2 2 10年32年息子选学入改I21需号份生修 择要62伞姓焦费身岀已 黃M4更入入入入光入息 请输tt3请sBg.KgHaBg捌信改琴修10王间号期要时证修改学生证信息的界面5系统使用说明1、进入程序时,先以菜单形式显示所有命令,然后用户通过菜单项选择操作;例如:1 学生证信息的键入2 输入学号,显示该生学生证信息3 输入班号,显示该班所有学生的学

7、生证信息4 给定学号,修改该生学生证信息5 退出系统请选择1/2/3/4/5:2、键入学生证信息时,按照所给定的格式输入。3、查询信息是按学生学号和班号的形式进行查询,填入学号后,则显示出该生所有信息;选择按班号查询功能后,在选择显示输出方式,分两种:一种按学号排序;另一种是按姓名排序。 选定后,再填入班号,则显示出该班所有学生的学生证信息(按已选定的排序方式显示)4、修改信息是按输入学号的形式进行修改,填入后,则显示出该生所有信息,然后询问是否修改, 若回答“ y”(大小写通用),则输入新值,否则不作修改。6C语言源程序代码#in elude <stdio.h>#i nclude

8、 <win dows.h>II#include <malloc.h>#in elude <stri ng.h>#in elude <stdlib.h>用来使用清屏函数#defi ne LEN sizeof(struct STUcard) struct STUcard *creat();void viewpers on();void viewclass();void nu mber();void n ame();void cha nge();struct STUcard *save();struct dateint year;int mon th;

9、int day;IIstruct STUcard int nu mber;char n ame20;char sex10;char departme nt20; char class nu mber10;struct date timeofe nter; II char IDnu mber30;struct date birthday; struct STUcard *n ext; II定义结构体定义用来嵌套的结构体嵌套结构体void mai n()char c;int n=0;struct STUcard *head;char build;IIFILE *fp;fp=fope n("

10、;XX.out","rb"); if(fp=NULL)创建文件printf(" 文件不存在,请创建( Y or N ) "); scanf("%c",&build);if(build='Y')fp=fopen("XX.out","wb");elseexit(0);dosystem("cls"); / 清屏printf("1:输入学生证信息n");printf("2:查找个人信息n");printf(&q

11、uot;3:查找班级里所有学生的学生证信息printf("4:修改学生证信息n");printf("5:退出n");printf( "*printf( "*n");printf(" n");printf(" 请选择输入选项 12345:>"); doc=getchar();while(c!='1'&&c!='2'&&c!='3'&&c!='4'&&c!=

12、'5'); getchar();switch(c)case '1': head=creat(); break; case '2': viewperson(head); break; case '3': viewclass(head); break; case '4': change(head); break; case '5': exit(0); break;printf(" 按任意键返回主菜单 :n"); flushall();getchar(); printf("%

13、d",n); system("cls");while(1);int n;struct STUcard *creat() /录入学生证信息函数struct STUcard *head,*p1,*p2;n=0;head=NULL;p1=p2=(struct STUcard *)malloc(LEN);printf(”请按以下格式输入学生证信息,注意每个数据之间间隔一个空格!n以学号为00000000结束录入,并且剩下的信息字符用“0”代替输入 注意:输入格式不变!:n");printf("学号 姓名 性别 院系 班级 入学时间(年 月曰)身份证号

14、出生日期(年 月日) n");scanf("%d %s %s %s %s %d %d %d %s %d %d %d",&p1->number,p1->name,p1->sex,p1->d epartme nt,p1->class nu mber,&p1->timeofe nter.year, &p1->timeofe nter.m on th,&p1->timeofe nter.day,p1->ID nu mber, &p1->birthday.year,&

15、p1->birthday. mon th, &p1->birthday.day);while(p1-> nu mber!=00000000)n=n+1;if(n=1) head=p1;else p2->n ext=p1;p2=p1;p仁(struct STUcard *)malloc(LEN);scan f("%d %s %s %s %s %d %d %d %s %d %d %d",&p1-> nu mber,p1-> name,p1->sex,p 1->departme nt,p1->class nu

16、mber,&p1->timeofe nter.year,&p1->timeofe nter.m onth,&p1->timeofe nter.day,p1->ID nu mber,&p1->birthday.year, &p1->birthday. mon th,&p1->birthday.day);p2-> next=NULL;free(p1);save(head);/保存文件return(head);/把已录入信息的链表头指针返回给住函数void viewperso n(struct STUca

17、rd * head) /查找个人信息函数int m,a=0;struct STUcard *p;printf("请输入学号:");prin tf("n ");scan f("%d", &m);p=head;/获取头指针,以使用链表while(p->next!=NULL) / 判断是否为空指针if(p->number=m)printf(" 学号: %dn 姓名: %sn 性别: %sn 院系: %sn 班级: %sn 入学时间:月°%d日 n身份证号:sn出生日期:4年4月%d0 n",

18、p->number,p->name,p->sex,p->department,p->classnumber,p->timeofenter.year,p->timeofenter.month,p->timeofenter.day,p->IDnumber,p->birthday.year,p->birthday.month,p->birthday.day);printf("n");a=a+1;p=p->next; /结点后移if(p->number=m)printf(" 学号: %dn

19、 姓名: %sn 性别: %sn 院系: %sn 班级: %sn 入学时间: 月d日n身份证号:%sn出生日期:4年4月%d日n",%4年 %d%4年 %dp->number,p->name,p->sex,p->department,p->classnumber,p->timeofenter.year,p->timeofenter.month,p->timeofenter.day,p->IDnumber,p->birthday.year,p->birthday.month,p->birthday.day);pri

20、ntf("n");a=a+1;printf("n");prin tf(”共 dA n",a);if(a=0) printf(" 对不起,查无此人 !n");void viewclass(struct STUcard * head) /查找班级信息函数char c;void number();void name(); dosystem("cls"); /清屏printf(*n");printf(" 1:按学号排序输出n");printf(" 2:按姓名排序输出n&qu

21、ot;);printf(" 3:退出n");printf(*n");prin tf(”n");printf("请选择输入选项123:>");doc=getchar();while(c!='1'&&c!='2'&&c!=3);getchar();switch(c)case '1':nu mber(head); break;case '2':n ame(head); break;case '3':exit(0); cont

22、inue;printf(”按任意键返回上层菜单:n");flushall();getchar();system("cls");while(1);void number(struct STUcard *head) /按学号排序char c10;int h1,a=0,i,j,k,w;char hn ame20;char hsex20;char hdepartme nt20;char hclass nu mber10;char hID number30;struct date htimeofe nter;struct date hbirthday;struct STUc

23、ard *p,*p2,*p3;p=head;p2=head;p3=p2->n ext;for(k=1;k+)/用来确定链表中共多少个结点if(p->n ext!=NULL) p=p->n ext;else break;for(i=0;i<k-1;i+)p2=head; p3=p2->next;for(j=0;j<k-1-i;j+)if(p2->number>p3->number)h1=p2->number;strcpy(hname,p2->name);strcpy(hsex,p2->sex); strcpy(hdepart

24、ment,p2->department); strcpy(hclassnumber,p2->classnumber); strcpy(hIDnumber,p2->IDnumber); htimeofenter=p2->timeofenter; hbirthday=p2->birthday; p2->number=p3->number;2->name,p3->name);strcpy(p2->sex,p3->sex); strcpy(p2->department,p3->department); strcpy(p2-&

25、gt;classnumber,p3->classnumber); strcpy(p2->IDnumber,p3->IDnumber); p2->timeofenter=p3->timeofenter; p2->birthday=p3->birthday;p3->number=h1;strcpy(p3->name,hname);strcpy(p3->sex,hsex); strcpy(p3->department,hdepartment); strcpy(p3->classnumber,hclassnumber); strc

26、py(p3->IDnumber,hIDnumber); p3->timeofenter=htimeofenter; p3->birthday=hbirthday; p2=p3; p3=p3->next;printf("请输入班级: n");scanf("%s",&c); p=head;printf("n");if(strcmp(p->class nu mber,c)=O)%4年 %dprintf(" 学号:dn姓名:%sn性别:%sn院系:%sn班级:%sn入学时间: 月d日n身份证号:

27、%sn出生日期:4年4月%d日n",p->nu mber,p->n ame,p->sex,p->departme nt,p->class nu mber,p->timeofe nter.year,p->timeofe nter.m on th,p->timeofe nter.day,p->ID nu mber, p->birthday.year,p->birthday. mon th,p->birthday.day);a=a+1;p=p->n ext;prin tf("n");prin

28、tf("共 dA n",a);if(a=0) printf("对不起无此班级");void n ame(struct STUcard *head) /按姓名排序char c10;int h1,a=O,i,j,k,w;char hn ame20;char hsex20;char hdepartme nt20;char hclass nu mber10;char hID number30;struct date htimeofe nter;struct date hbirthday;struct STUcard *p,*p2,*p3;p=head;p2=he

29、ad;p3=p2->n ext;for(k=1;k+)if(p->n ext!=NULL) p=p->n ext;else break;for(i=0;i<k-1;i+)p2=head;p3=p2->n ext;for(j=0;j<k-1-i;j+)if(strcmp(p2->n ame,p3->n ame)>0)h1=p2->nu mber;strcpy(hname,p2->name);strcpy(hsex,p2->sex); strcpy(hdepartment,p2->department); strcpy(

30、hclassnumber,p2->classnumber); strcpy(hIDnumber,p2->IDnumber); htimeofenter=p2->timeofenter;hbirthday=p2->birthday;p2->number=p3->number;strcpy(p2->name,p3->name);strcpy(p2->sex,p3->sex); strcpy(p2->department,p3->department); strcpy(p2->classnumber,p3->clas

31、snumber); strcpy(p2->IDnumber,p3->IDnumber); p2->timeofenter=p3->timeofenter;p2->birthday=p3->birthday;p3->number=h1;strcpy(p3->name,hname);strcpy(p3->sex,hsex); strcpy(p3->department,hdepartment); strcpy(p3->classnumber,hclassnumber); strcpy(p3->IDnumber,hIDnumbe

32、r); p3->timeofenter=htimeofenter;p3->birthday=hbirthday;p2=p3;p3=p3->next;printf(" 请输入班级: n");scanf("%s",&c);p=head;for(w=1;w<=k;w+)printf("n");if(strcmp(p->classnumber,c)=0)%4年 %dprintf("学号:dn姓名:sn性别:sn院系:sn班级:sn入学时间:月d日n身份证号:%sn出生日期:4年4月%d日n&qu

33、ot;, p->number,p->name,p->sex,p->department,p->classnumber, p->timeofenter.year,p->timeofenter.month,p->timeofenter.day,p->IDnumber, p->birthday.year,p->birthday.month,p->birthday.day);a=a+1;p=p->n ext;prin tf("n");prin tf("共 dA n",a);if(a=0

34、) printf("对不起无此班级");void cha nge(struct STUcard * head) /修改信息 int x;struct STUcard *p1,*p2;prin tf("输入要修改学生的学号n");scan f("%d", &x);p仁head;while(p1-> nu mber!=x )&&(p1-> next!=NULL)p2=p1;p1=p1- >n ext;if(p1- >nu mber=x)printf("请输入需要修改的信息:n&qu

35、ot;);prin tf("输入学号:");scan f("%d", &p1-> nu mber);prin tf("输入姓名:");sca nf("%s",p1- >n ame);prin tf("输入性别:");scan f("%s",p1->sex);prin tf("输入院系:");sca nf("%s",p1->departme nt);prin tf("输入班级:");sc

36、a nf("%s",p1->class nu mber);printf("输入入学时间(年月曰):");sca nf("%d %d %d",&p1->timeofe nter.year,&p1->timeofe nter.m on th,&p1->timeofe nter.day); printf("输入身份证号:");scan f("%s",p1->ID number);printf("输入出生日期(年月 日:”);scan f(

37、"%d %d %d",&p1->birthday.year,&p1->birthday.mo nth,&p1->birthday.day);printf("信息已修改");save(head);else printf("%d找不到该学号!n",x);struct STUcard *save(struct STUcard *head) / 保存函数 FILE *fp;struct STUcard *p;p=head;fp=fopen("XX.out","w+&quo

38、t;);if(fp=0)printf(" 不能打开文件 ");exit(0);while (p)fprintf(fp," 学号:dn姓名:sn性别:sn院系:sn班级:sn入学时间:4年%d 月%d0 n身份证号:%sn出生日期:4年4月%d0 n",p->number,p->name,p->sex,p->department,p->classnumber, p->timeofenter.year,p->timeofenter.month,p->timeofenter.day,p->IDnumber, p->birthday.

温馨提示

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

评论

0/150

提交评论