班级档案管理系统课程设计报告(编辑修改稿)内容摘要:

ULL (插到表尾之后 ) q 指向头结点 是 是 否 否 这是一个不返回值的有参函数,形参为“链表头的指针”,可以把学生记录保存在电脑上由自己任意命名的二进制文件。 NS 流程图如下: 息,并返回菜单 STUDENT *load() 这是一个不返回值的有参函数,形参为“链表头的指针”,根据输入的文件地址进行读取。 NS 流程图如下 : 定义两个指针变量 p1,p2 输入要打开的记录文件地址 infile 文件不能打开 否 是 开辟一个新单元 指针 p1 是否为空 返回菜单 否 是 返回菜单 读入记录 fclose(fp)。 (关闭文件 ) 六 、 函数间的调用关系图 1 main 函数的下属子功能函数及其调用示意图 输入要保存记录的文件地址 outfile 文件不能打开 否 是 输出一个出错信息,并返回菜单 p=head 当 p 不为空时 fwrite(p,LEN,1,fp)。 (写入一条记录 ) p=p— next。 (指针后移 ) fclose(fp)。 (关闭文件 ) 2 统计函数的下属功能函数及其调用示意图 (1) main() insert() exit() save() create() delete() print() search() load() menu_select() getch() gotoxy() cprintf() menu_select() textcolor putch() window() textbackground() malloc() inputs() create() sizeof() (2) (3) ( 4) sizeof() malloc() fwrite() fopen() fread() save() feop() fopen() sizeof() fclose() load() fclose() insert() (5) (6) (7) 七、 主控模块和部分子模块 inputs() strcmp() malloc() strcpy() inputs() putchar() strcmp() getch() delete() strlen() search() strcmp() 开始 主菜单 八 、 附件 include /*I/O 函数 */ include /*I/O 函数 */ include /*字符串函数 */ include /*屏幕操作函数 */ define N 10 int M=0。 struct student { char num[13]。 char name[20]。 char sex。 char address[30]。 int age。 }。 typedef struct LB { struct student XINXI。 struct LB *next。 }LB_1,*LB_2。 void CAIDANG() { printf( \t \t \t (欢迎使用本班级档案管理系统 )\t\t\t\t\n)。 printf(★ *★ *★ *★ *★ *★ *★ *★ *★ *★ 欢迎进入我们的系统 ★ *★ *★ *★ *★ *★ *★ *★ *★ *★ \n\n)。 printf( 湖南工程学院 0783 班 C 语言课程设计《班级档案管理系统》欢迎您。 \n\n)。 printf( \t\t\t\t\ \n\n)。 printf( \t\t\t\t\ \n\n)。 printf( \t\t\t\t\ \n\n)。 printf( \n)。 printf(★ *★ *★ *★ *★ *★ *★ *★ *★ *★ 欢迎进入本系统 ★ *★ *★ *★ *★ *★ *★ *★ *★ *★ \n)。 } /*文本颜色 */ void color() { textbackground(8)。 textcolor(9)。 clrscr()。 } void Wrong() { printf(\n对不起您的输入错误 !\n)。 } void SORRY() { printf(\n对不起该同学现没有任何信息 !\n)。 } void printe(LB_1 *p)/* 本函数用于输出英文 */ { printf( %2s %s\t %s\t%s\t %d\t \n,p,p,p,p,pXINXI.age)。 } /* 该函数用于定位链表中符合要求的接点,并返回该指针 */ LB_1 *Locate(LB_2 l,char findmess[],char nameornum[]) { LB_1 *r。 if(strcmp(nameornum,num)==0) /* 按学号查询 */ { r=lnext。 while(r!=NULL) { if(strcmp(r,findmess)==0) return r。 r=rnext。 } } else if(strcmp(nameornum,name)==0) /* 按姓名查询 */ { r=lnext。 while(r!=NULL) { if(strcmp(r,findmess)==0) return r。 r=rnext。 } } return 0。 } /*以下是增加学生信息的函数 */ void TIANJIA(LB_2 l) { LB_1 *p,*r,*s。 char num[13]。 r=l。 s=lnext。 while(rnext!=NULL) /*些处循环一直到最后 */ r=rnext。 while(1) { printf( 请输入添加的学生学号 (输入 39。 039。 返回上一级菜单 :))。 scanf(%s,num)。 if(strcmp(num,0)==0) break。 while(s) { if(strcmp(s,num)==0) { printf((必看提示) :学号为 39。 %s39。 的学生已有信息 ,若要修改请你输入39。 2 修改 39。 !\n,num)。 printe(s)。 printf(\n)。 return。 } s=snext。 } p=(LB_1 *)malloc(sizeof(LB_1))。 strcpy(p,num)。 printf( 请你输入学号 :)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。