学生学籍管理系统文档格式.docx
《学生学籍管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《学生学籍管理系统文档格式.docx(39页珍藏版)》请在冰豆网上搜索。
![学生学籍管理系统文档格式.docx](https://file1.bdocx.com/fileroot1/2022-12/1/eb653ea2-0aba-46bd-8bb0-65e9039ad2de/eb653ea2-0aba-46bd-8bb0-65e9039ad2de1.gif)
voidA1search(structstudent*s_list,structgradeinform*g_list);
voidA2search(structstudent*s_list,structgradeinform*g_list);
voidBsearch(structstudent*s_list,structgradeinform*g_list);
voidB1search(structstudent*s_list,structgradeinform*g_list);
structstudent*dele(structstudent*s_list,structgradeinform*g_list);
structstudent*arrange(structstudent*s_list,structgradeinform*g_list);
structstudent*Auparrange(structstudent*s_list,structgradeinform*g_list);
structstudent*Buparrange(structstudent*s_list,structgradeinform*g_list);
structstudent*Adnarrange(structstudent*s_list,structgradeinform*g_list);
structstudent*Bdnarrange(structstudent*s_list,structgradeinform*g_list);
voidAexchange(structstudent*p1,structstudent*p2);
voidBexchange(structgradeinform*p3,structgradeinform*p4);
structstudent*Ainsert(structstudent*node,structstudent*s_list);
//插入学生基本信息节点
structgradeinform*Binsert(structgradeinform*node,structgradeinform*g_list);
//插入学生成绩信息节点
structstudent*Acreat();
//创建单个节点保存学生基本信息
structgradeinform*Bcreat();
//创建单个节点保存学生成绩信息
voidClear(structstudent*s_list,structgradeinform*g_list);
//清空链表
structstudent*Ainput(structstudent*s_list);
//输入学生基本信息
structgradeinform*Binput(structgradeinform*g_list);
//输入学生成绩信息
voidoutput(structstudent*s_list,structgradeinform*g_list);
//显示所有学生信息
voidoutputone(structstudent*s_list,structgradeinform*g_list);
//显示单个学生全部信息信息
voidoutput1(structstudent*s_list);
//显示单个学生基本信息
#include<
stdio.h>
#include<
malloc.h>
string.h>
stdlib.h>
#include"
student.h"
voidmain()
structstudent*s_list=NULL;
structgradeinform*g_list=NULL;
s_list=Aread();
g_list=Bread();
menu(s_list,g_list);
}
voidmenu(structstudent*s_list,structgradeinform*g_list)
intn;
do
{
printf("
\n\n"
);
\t\t****************学生学籍管理系统****************\n\n"
\t\t学生基本信息文件读取---------------------------1\n"
\t\t学生成绩信息文件读取---------------------------2\n"
\t\t文件保存---------------------------------------3\n\n"
\t\t************************************************\n\n"
\t\t输入新学生信息---------------------------------4\n"
\t\t显示所有学生信息-------------------------------5\n\n"
\t\t数据查询---------------------------------------6\n"
\t\t数据删除---------------------------------------7\n"
\t\t数据排序---------------------------------------8\n\n"
\t\t退出系统---------------------------------------0\n\n"
请输入:
"
scanf("
%d"
&
n);
\n"
switch(n)
{
case1:
break;
case2:
case3:
save(s_list,g_list);
case4:
s_list=Ainput(s_list),g_list=Binput(g_list);
break;
case5:
output(s_list,g_list);
case6:
search(s_list,g_list);
case7:
dele(s_list,g_list);
case8:
arrange(s_list,g_list);
case0:
save(s_list,g_list),Clear(s_list,g_list);
printf("
\n\n再见!
}
}while(n!
=0);
//数据查询
voidsearch(structstudent*s_list,structgradeinform*g_list)
printf("
\t\t\t***********查询功能***********\n\n"
\t\t\t学生基本情况查询-------------1\n"
\t\t\t成绩查询---------------------2\n\n"
\t\t\t******************************\n\n"
scanf("
switch(n)
case1:
Asearch(s_list,g_list);
case2:
Bsearch(s_list,g_list);
}
if(n!
=1&
&
n!
=2)
menu(s_list,g_list);
voidAsearch(structstudent*s_list,structgradeinform*g_list)
\t\t\t********学生基本情况查询********\n\n"
\t\t\t按学号或姓名查询---------------1\n"
\t\t\t按宿舍号码查询-----------------2\n\n"
\t\t\t********************************\n\n"
A1search(s_list,g_list);
A2search(s_list,g_list);
voidBsearch(structstudent*s_list,structgradeinform*g_list)
B1search(s_list,g_list);
//数据排序
structstudent*arrange(structstudent*s_list,structgradeinform*g_list)
\t\t\t********学生信息排序********\n\n"
\t\t\t按综合成绩升序排列---------1\n"
\t\t\t按实得学分升序排列---------2\n"
\t\t\t按综合成绩降序排列---------3\n"
\t\t\t按实得学分降序排列---------4\n\n"
\t\t\t****************************\n\n"
Auparrange(s_list,g_list);
Buparrange(s_list,g_list);
case3:
Adnarrange(s_list,g_list);
case4:
Bdnarrange(s_list,g_list);
if(n<
1||n>
4)
returns_list;
/*
intdele()
\t\t\t******按学号或姓名删除信息******\n\n"
\t\t\t按学号删除---------------------1\n"
\t\t\t按姓名删除---------------------2\n"
returnn;
*/
structstudent*Ainsert(structstudent*node,structstudent*s_list)//插入学生基本信息节点
structstudent*p1;
structstudent*p2;
p1=p2=s_list;
if(s_list==NULL)
s_list=node;
s_list->
next=NULL;
returns_list;
else
while(p1!
=NULL)
p2=p1;
p1=p1->
next;
p2->
next=node;
node->
structgradeinform*Binsert(structgradeinform*node,structgradeinform*g_list)//插入学生成绩信息节点
structgradeinform*p1;
structgradeinform*p2;
p1=p2=g_list;
if(g_list==NULL)
g_list=node;
g_list->
returng_list;
returng_list;
structstudent*Acreat()//创建单个节点保存学生基本信息
structstudent*node=NULL;
if((node=(structstudent*)malloc(sizeof(structstudent)))==NULL)
内存不足,请释放内存之后重试!
returnNULL;
}
memset(node,0,sizeof(structstudent));
returnnode;
structgradeinform*Bcreat()//创建单个节点保存学生成绩信息
structgradeinform*node=NULL;
if((node=(structgradeinform*)malloc(sizeof(structgradeinform)))==NULL)
memset(node,0,sizeof(structgradeinform));
voidAexchange(structstudent*p1,structstudent*p2)
num=p1->
num;
p1->
num=p2->
p2->
num=num;
strcpy(name,p1->
name);
strcpy(p1->
name,p2->
strcpy(p2->
name,name);
strcpy(sex,p1->
sex);
sex,p2->
sex,sex);
dornum=p1->
dornum;
dornum=p2->
dornum=dornum;
strcpy(phone,p1->
phone);
phone,p2->
phone,phone);
voidBexchange(structgradeinform*p3,structgradeinform*p4)
num=p3->
p3->
num=p4->
p4->
strcpy(classnum,p3->
classnum);
strcpy(p3->
classnum,p4->
strcpy(p4->
classnum,classnum);
strcpy(classname,p3->
classname);
classname,p4->
classname,classname);
credit=p3->
credit;
credit=p4->
credit=credit;
Ugrade=p3->
Ugrade;
Ugrade=p4->
Ugrade=Ugrade;
Egrade=p3->
Egrade;
Egrade=p4->
Egrade=Egrade;
Jgrade=p3->
Jgrade;
Jgrade=p4->
Jgrade=Jgrade;
Sgrade=p3->
Sgrade;
Sgrade=p4->
Sgrade=Sgrade;
Rgrade=p3->
Rgrade;
Rgrade=p4->
Rgrade=Rgrade;
voidCle