学生证信息管理系统Word格式文档下载.docx
- 文档编号:19355168
- 上传时间:2023-01-05
- 格式:DOCX
- 页数:24
- 大小:282.86KB
学生证信息管理系统Word格式文档下载.docx
《学生证信息管理系统Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《学生证信息管理系统Word格式文档下载.docx(24页珍藏版)》请在冰豆网上搜索。
5系统使用说明
1、进入程序时,先以菜单形式显示所有命令,然后用户通过菜单项选择操作;
例如:
1学生证信息的键入
2输入学号,显示该生学生证信息
3输入班号,显示该班所有学生的学生证信息
4给定学号,修改该生学生证信息
5退出系统
请选择[1/2/3/4/5]:
2、键入学生证信息时,按照所给定的格式输入。
3、查询信息是按学生学号和班号的形式进行查询,填入学号后,则显示出该生所有信息;
选择按班号查询功能后,在选择显示输出方式,分两种:
一种按学号排序;
另一种是按姓名排序。
选定后,再填入班号,则显示出该班所有学生的学生证信息(按已选定的排序方式显示)。
4、修改信息是按输入学号的形式进行修改,填入后,则显示出该生所有信息,然后询问是否修改,若回答“y”(大小写通用),则输入新值,否则不作修改。
6C语言源程序代码
#include<
stdio.h>
windows.h>
//用来使用清屏函数
malloc.h>
string.h>
stdlib.h>
#defineLENsizeof(structSTUcard)
structSTUcard*creat();
voidviewperson();
voidviewclass();
voidnumber();
voidname();
voidchange();
structSTUcard*save();
structdate{
intyear;
intmonth;
intday;
};
//定义用来嵌套的结构体
structSTUcard{
intnumber;
charname[20];
charsex[10];
chardepartment[20];
charclassnumber[10];
structdatetimeofenter;
//嵌套结构体
charIDnumber[30];
structdatebirthday;
structSTUcard*next;
//定义结构体
voidmain()
{
charc;
intn=0;
structSTUcard*head;
charbuild;
//创建文件
FILE*fp;
fp=fopen("
XX.out"
"
rb"
);
if(fp==NULL)
{
printf("
文件不存在,请创建(YorN)"
scanf("
%c"
&
build);
if(build=='
Y'
)
wb"
else
exit(0);
}
do
system("
cls"
//清屏
printf("
*****************************************\n"
1:
输入学生证信息\n"
2:
查找个人信息\n"
3:
查找班级里所有学生的学生证信息\n"
4:
修改学生证信息\n"
5:
退出\n"
\n"
请选择输入选项[1\\2\\3\\4\\5]:
>
"
c=getchar();
}while(c!
='
1'
&
c!
2'
3'
4'
5'
getchar();
switch(c)
case'
:
head=creat();
break;
viewperson(head);
viewclass(head);
change(head);
按任意键返回主菜单:
\n"
flushall();
%d"
n);
}while
(1);
}
intn;
structSTUcard*creat()//录入学生证信息函数
structSTUcard*head,*p1,*p2;
n=0;
head=NULL;
p1=p2=(structSTUcard*)malloc(LEN);
请按以下格式输入学生证信息,注意每个数据之间间隔一个空格!
\n以学号为00000000结束录入,并且剩下的信息字符用“0”代替输入注意:
输入格式不变!
学号姓名性别院系班级入学时间(年月日)身份证号出生日期(年月日)\n"
%d%s%s%s%s%d%d%d%s%d%d%d"
p1->
number,p1->
name,p1->
sex,p1->
department,p1->
classnumber,
&
timeofenter.year,&
timeofenter.month,&
timeofenter.day,p1->
IDnumber,
birthday.year,&
birthday.month,&
birthday.day);
while(p1->
number!
=00000000)
{
n=n+1;
if(n==1)head=p1;
elsep2->
next=p1;
p2=p1;
p1=(structSTUcard*)malloc(LEN);
}
p2->
next=NULL;
free(p1);
save(head);
//保存文件
return(head);
//把已录入信息的链表头指针返回给住函数
voidviewperson(structSTUcard*head)//查找个人信息函数
intm,a=0;
structSTUcard*p;
请输入学号:
\n"
m);
p=head;
//获取头指针,以使用链表
while(p->
next!
=NULL)//判断是否为空指针
if(p->
number==m)
学号:
%d\n姓名:
%s\n性别:
%s\n院系:
%s\n班级:
%s\n入学时间:
%d年%d月%d日\n身份证号:
%s\n出生日期:
%d年%d月%d日\n"
p->
number,p->
name,p->
sex,p->
department,p->
timeofenter.year,p->
timeofenter.month,p->
timeofenter.day,p->
birthday.year,p->
birthday.month,p->
printf("
a=a+1;
p=p->
next;
//结点后移
if(p->
number==m)
共%d人\n"
a);
if(a==0)printf("
对不起,查无此人!
voidviewclass(structSTUcard*head)//查找班级信息函数
voidnumber();
voidname();
do
****************************************\n"
按学号排序输出\n"
按姓名排序输出\n"
请选择输入选项[1\\2\\3]:
number(head);
name(head);
continue;
按任意键返回上层菜单:
voidnumber(structSTUcard*head)//按学号排序
charc[10];
inth1,a=0,i,j,k,w;
charhname[20];
charhsex[20];
charhdepartment[20];
charhclassnumber[10];
charhIDnumber[30];
structdatehtimeofenter;
structdatehbirthday;
structSTUcard*p,*p2,*p3;
p2=head;
p3=p2->
for(k=1;
;
k++)//用来确定链表中共多少个结点
=NULL)p=p->
elsebreak;
for(i=0;
i<
k-1;
i++)
p2=head;
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(hdepartment,p2->
department);
strcpy(hclassnumber,p2->
classnumber);
strcpy(hIDnumber,p2->
IDnumber);
htimeofenter=p2->
timeofenter;
hbirthday=p2->
birthday;
p2->
number=p3->
strcpy(p2->
name,p3->
strcpy(p2->
sex,p3->
department,p3->
classnumber,p3->
IDnumber,p3->
timeofenter=p3->
birthday=p3->
p3->
number=h1;
strcpy(p3->
name,hname);
sex,hsex);
department,hdepartment);
classnumber,hclassnumber);
IDnumber,hIDnumber);
p3->
timeofenter=htimeofenter;
birthday=hbirthday;
}
p2=p3;
p3=p3->
请输入班级:
%s"
c);
for(w=1;
w<
=k;
w++)
if(strcmp(p->
classnumber,c)==0)
对不起无此班级"
voidname(structSTUcard*head)//按姓名排序
k++)
if(strcmp(p2->
name)>
0)
voidchange(structSTUcard*head)//修改信息
{intx;
structSTUcard*p1,*p2;
输入要修改学生的学号\n"
x);
p1=head;
while((p1->
=x)&
(p1->
=NULL))
p2=p1;
p1=p1->
if(p1->
number==x)
请输入需要修改的信息:
输入学号:
number);
输入姓名:
p1->
输入性别:
输入院系:
输入班级:
输入入学时间(年月日):
%d%d%d"
timeofenter.day);
输入身份证号:
输入出生日期(年月日):
信息已修改"
save(head);
elseprintf("
%d找不到该学号!
x);
structSTUcard*save(stru
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生证 信息管理 系统
![提示](https://static.bdocx.com/images/bang_tan.gif)