学生选课管理系统全源代码Linux环境Word文件下载.docx
- 文档编号:17596399
- 上传时间:2022-12-07
- 格式:DOCX
- 页数:66
- 大小:30.53KB
学生选课管理系统全源代码Linux环境Word文件下载.docx
《学生选课管理系统全源代码Linux环境Word文件下载.docx》由会员分享,可在线阅读,更多相关《学生选课管理系统全源代码Linux环境Word文件下载.docx(66页珍藏版)》请在冰豆网上搜索。
_INLINE_voidlist_del(structlist_head*entry)
__list_del(entry->
prev,entry->
_INLINE_voidlist_del_init(structlist_head*entry)
INIT_LIST_HEAD(entry);
_INLINE_intlist_empty(structlist_head*head)
returnhead->
next==head;
_INLINE_voidlist_splice(structlist_head*list,structlist_head*head)
structlist_head*first=list->
next;
if(first!
=list){
structlist_head*last=list->
prev;
structlist_head*at=head->
first->
prev=head;
head->
next=first;
last->
next=at;
at->
prev=last;
}
#definelist_entry(ptr,type,member)\
((type*)((char*)(ptr)-(unsignedlong)(&
((type*)0)->
member)))
#definelist_for_each(pos,head)\
for(pos=(head)->
pos!
=(head);
pos=pos->
next)
#definelist_for_each_safe(pos,pnext,head)\
next,pnext=pos->
pos=pnext,pnext=pos->
#undef_INLINE_
#endif
//**********************************************************************8
//***********************************************************************
//****头文件head.h
#ifndef_HEAD_H_
#define_HEAD_H_
#include<
string.h>
#include"
list.h"
stdio.h>
stdlib.h>
time.h>
#defineY'
y'
#defineN'
n'
#defineA_FLAG'
a'
#defineS_FLAG'
s'
#defineT_FLAG'
t'
externstructlist_headstu;
//
externstructlist_headtec;
//科目信息
typedefstructsubject_info
floatSUB_notes[3];
//科目成绩
intSUB_csscore;
//科目学分
charSUB_csname[32];
//科目名称
structlist_headlist;
}SUB;
//学生信息
typedefstructSTU_info
floatSTU_totalscore;
//总分
intSTU_id;
//学号
intSTU_age;
//年龄
intSTU_grade;
//年级
intSTU_place;
//名次
charSTU_name[32];
//姓名
charSTU_psword[32];
//密码
SUBsubject[3];
}STU;
//教师信息:
typedefstructTCH_info
intTCH_id;
//工号
charTCH_name[32];
//姓名
charTCH_psword[32];
SUBsubject[1];
}TEC;
//管理员信息
typedefstructADM_info
charADM_usename[8];
charADM_psword[6];
}ADM;
ADMuse[1];
voidgettime();
//获取当前时间
voidmain_menu();
//主菜单
voidstu_login();
//学生登录
voidopenf(char*filename);
//判断文件是否存在
voidtec_login();
//老师登录
voidadm_login();
//管理员登录
voidadm_nextmenu();
//管理员2级菜单
voida_updt_stuinfo();
//操作学生信息
voida_updt_tecinfo();
//操作老师信息
voida_updt_myinfo();
//操作管理员自身信息
voida_add_stuinfo();
//添加学生信息
voida_add_tecinfo();
//添加老师信息
voida_mdify_stuinfo();
//修改学生信息
voida_del_info(charflag);
//删除信息
voida_mdify_tecinfo();
//修改老师信息
voida_seek_stuinfo();
//查找学生信息
voida_seek_tecinfo();
//查找老师信息
voidshow(charflag);
//显示信息
voidsave(charflag,charsystem);
//保存信息
voidcheck(charflag);
//验证密码
voidcommom();
//公用函数集合
voida_show(charflag);
voida_seek_info(charflag);
//查找信息
voida_mdify_info(charflag);
//修改学生或老师信息
voidstu_nextmenu(inttmpid);
//学生菜单
voidtec_nextmenu(inttmpid);
//老师菜单
voids_show_myinfo(inttmpid);
//学生显示自己信息
voidt_show_myinfo(inttmpid);
//教师显示自己信息
voids_updt_myinfo(inttmpid);
//学生更新自己信息
voids_select_subject(inttmpid);
//学生选课
voidt_updt_stuinfo(inttmpid);
//教授更新自己信息
voidt_updt_myinfo(inttmpid);
//教授显示自己信息
voidreadf();
//从文件中读取信息
voidstu_sort();
floatave(floatcore[3]);
float(*f)(floatcore[3]);
intinputpsword(char*pass);
voida_chpsword();
//*************************************************************************
//入口main函数
head.h"
LIST_HEAD(stu);
LIST_HEAD(tec);
intmain()
readf();
system("
clear"
);
printf("
\t\t\t**\t\t*\n\
**\t\t*Copyright(c)2010,易嵌教育\n\
**\t\t*Allrightsreserved.\n\
**\t\t*\n\
**\t\t*软件名称:
学生选课管理系统\n\
**\t\t*摘要:
\n\
**\t\t*当前版本:
1.1\n\
**\t\t*作者:
关仁杰\n\
**\t\t*完成日期:
2010年8月2日\n\
**\t\t*\n"
//voiddelay(unsingedint)
sleep
(2);
main_menu();
return0;
voidmain_menu()
{
intch;
charhc;
gettime();
\t\t\t==学生信息管理系统==\n\n"
\t\t###############################################\n"
\t\t==*欢迎使用本系统\a*==\n"
\t\t###############################################\n\n"
\t\t++++++++++++++++++++++++++++++++++++++++++++++++++\n"
\t\t==1.学生==\n"
\t\t==2.教师==\n"
\t\t==3.管理员==\n"
\t\t==4.退出==\n"
请输入您选择的序号:
\n"
scanf("
%d"
&
ch);
switch(ch)
{
case1:
printf("
您的身份是学生!
\n请登录:
gettime();
openf("
student.txt"
check(S_FLAG);
break;
case2:
您的身份是教师!
teacher.txt"
check(T_FLAG);
break;
case3:
您的身份是管理员!
\n请登录\n"
adm_login();
case4:
\a\a\a您已经保存相应的数据了吗?
(yorn)\n"
getchar();
scanf("
%c"
hc);
if((hc=='
)||(hc=='
Y'
))
{
printf("
谢谢您使用本系统,如有需要请联系:
QQ:
……\n"
请按Enter键退出!
getchar();
exit(0);
}
elseif((hc=='
N'
您还没有保存,系统将为您自动保存!
save(S_FLAG,Y);
default:
您的输入有误,请返回上级菜单!
main_menu();
//试读文件,验证是否建立
voidopenf(char*filename)
FILE*fp;
if((fp=fopen(filename,"
r"
))==NULL)
{
filename=NULL;
printf("
对不起!
还没有建立相应的信息!
\n请于管理员联系!
getchar();
getchar();
main_menu();
fclose(fp);
//管理员登录
voidadm_login()
charpsword[6];
inti=0;
if((fp=fopen("
psword.txt"
"
对不起没有相应的信息,请您建立!
请输入您的用户名(不得多于8:
个字符):
scanf("
%s"
use[0].ADM_usename);
请输入您的密码:
while((psword[i]=getchar())!
='
\n'
||(psword[i]=getchar())!
=EOF||i<
6)
{
putchar('
*'
i++;
}
strcmp(use[0].ADM_psword,psword);
save(A_FLAG,N);
//savetheinfo
else
check(A_FLAG);
//****************************************************************
//************************************
//管理员相关函数
#ifndef_ADM_nextmenu_c
#define_ADM_nextmenu_c
structlist_head*postion;
voidadm_nextmenu()
\t\t\t\t****************\n"
\n\n\t\t###################################\n"
\t\t==1.更改学生信息==\n"
\t\t==2.更改老师信息==\n"
\t\t==3.更改自己信息==\n"
\t\t==4.返回主菜单==\n"
\t\t###################################\n\n"
请输入您选择的代号:
"
switch(ch)
a_updt_stuinfo();
break;
a_updt_tecinfo();
a_updt_myinfo();
按Enter键返回主菜单!
getchar();
main_menu();
printf("
error!
//updateinfo
voida_updt_stuinfo()
\t\t==1.添加学生信息==\n"
\t\t==2.删除学生信息==\n"
\t\t==3.查找学生信息==\n"
\t\t==4.修改学生信息==\n"
\t\t==5.返回上一级菜单==\n"
a_add_stuinfo();
a_del_info(S_FLAG);
a_seek_stuinfo();
a_mdify_info(S_FLAG);
case5:
save(S_FLAG,N);
按Enter返回上一级菜单!
adm_nextmenu();
voida_updt_tecinfo()
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生 选课 管理 系统 源代码 Linux 环境