ImageVerifierCode 换一换
格式:DOCX , 页数:24 ,大小:148.22KB ,
资源ID:7997231      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7997231.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C语言课程设计报告学籍信息管理系统.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C语言课程设计报告学籍信息管理系统.docx

1、C语言课程设计报告学籍信息管理系统高级语言程序设计说明书设计题目:学籍信息管理系统题目要求 3需求分析 3总体设计 3需求分析 3解题的思路 3定义结构 3主程序的结构 3功能菜单模块 6输入模块 6检查输入错误模块 6输出模块 7查询模块 7排序模块 8保存模块 9读入模块 10运行与测试报告 11设计体会 13附录 13参考文献 20学籍信息管理系统一, 题目要求1、需求分析:学生基本信息、学生成绩基本信息要存入文件当中,因而要提供文件的输入输出操作;查询功能要求提供查找和显示操作; 删除功能要求实现删除操作; 排序功能要求实现排序操 作;另外还应该提供键盘式选择菜单以实现功能选择。 2、

2、总体设计:整个系统可以设计为数据录入模块、数据查询模块、数据删除模块和数据排序模块。 二,需求分析根据题目要求,学籍信息管理系统需要输入和输出等操作,在程序中,需要数据录入,查询,删除,删除和排序功能。三,解题的思路1.定义结构typedef struct stud /学生信息结构 long num; char name20; float score; Stud;struct stud_type struct stud; char k3; int jilu; typedef struct node Stud student; struct node *next; Node;2.主程序的结构vo

3、id main() char choose; int flag=1; while (flag) duru(stu); /调用读入函数,读取文件信息; menu(); /调用功能菜单函数,显示菜单项。 printf( 请选择:); choose=getchar(); switch(choose) case 1: read(); /调用建立链表的函数;输出链表信息; print(); printf(nPress any key Continue ); /getchar(); getchar(); break; case 2: /调用按学号查找学生信息的函数;并输出查找结果信息; long c; p

4、rintf(input the number you want to find:); scanf(%ld,&c); find(c); printf(nPress any key Continue.); getchar(); break; case 3: /调用按姓名查找学生信息的函数;并输出查找结果信息; char s20; printf(input the name you want to find:); scanf(%s,s); searchname(s); printf(n Press any key Continue.); getchar(); getchar(); break; ca

5、se 4: /调用根据学号删除某个学生信息的函数;并输出删除后的链表信息; Node *h; long n; printf(input the number you want to delete:); scanf(%ld,&n); h=del(n); if(h=NULL) printf(No find the student n); else print(); printf(n Press any key Continue.); getchar(); getchar(); break; case 5: /调用插入新的学生信息的函数;并输出插入后的链表信息; long a; printf(inp

6、ut the number for the new:n); scanf(%ld,&a); inser(a); 2 ;print(); printf(n Press any key Continue.); getchar(); getchar(); break; case 6: /调用按分数降序排序输出的函数;并输出排序后的链表信息; sort(1); print(); sort(0); printf(nPress any key Continue.); getchar(); getchar(); break;case 7: Save(stu); /调用保存函数,保存文件信息; print();

7、 printf(nPress any key Continue ); /getchar(); getchar(); break; case 0: /结束程序运行! flag=0; printf(n * The End! *n); break; default: printf(n Wrong Selection !(选择错误,重选)n); getchar(); 3功能菜单模块void menu() /综合作业功能菜单 printf( n 学 生 信 息 管 理 系 统n); printf( n 菜 单nn); printf( n 1. 数据录入 n); printf( n 2. 数据查询(学号)

8、n); printf( n 3. 数据查询(姓名) n); printf( n 4. 数据删除n); printf( n 5. 数据插入n); printf( n 6. 数据排序n); printf( n 7. 保存文件信息 n);printf( n 0. 退 出nn); 4.输入模块void read(void) long a; printf(input the number:); scanf(%ld,&a); while(a0) 3 ;inser(a); printf(input the number:); scanf(%ld,&a); 5.检查输入错误模块void inser(long

9、b) Node *last,*current,*p; current=head; while(current!=NULL&bcurrent-student.num) last=current; current=current-next; if(current=NULL|bstudent.num) printf(input the name,score:); p=(Node *)malloc(sizeof(Node); p-student.num=b; scanf(%s%f,p-student.name,&p-student.score); p-next=NULL; if(current=hea

10、d) p-next=head; head=p; Else p-next=current; last-next=p; else if(b=current-student.num) printf(error input a different number:); 6.输出模块void print() Node *p=head; printf(学号 姓名 成绩:n); while(p!=NULL) printf(%ld %s %fn,p-student.num,p-student.name,p-student.score); p=p-next; 4 ;printf(n); 7查询模块 void fi

11、nd(long b) Node *p=head; while(p!=NULL&b!=p-student.num) p=p-next; if(!p) printf(No foundn); else printf(学号 姓名 成绩n); printf(%ld %s %fn,p-student.num,p-student.name,p-student.score); void searchname(char *s) Node *p=head; int flag=0; printf(学号 姓名 成绩:n); while(p!=NULL) if(strcmp(p-student.name,s)=0) p

12、rintf(%ld %s %fn,p-student.num,p-student.name,p-student.score); flag=1; p=p-next; continue; else p=p-next; if(!flag) printf(No find); Node * del(long n) Node *p=head,*last; while(p-student.num!=n) last=p; p=p-next; if(p=NULL) return p; else if(p=head) head=p-next; else last-next=p-next; 5 ;return he

13、ad; 8.排序模块void sort(int flag) /*flag=1 按分数排序 else 按学号排序*/ Node *p1,*p2,*k; float t1; long t2; char s20; for(p1=head;p1-next;p1=p1-next) k=p1; for(p2=p1-next;p2;p2=p2-next) if(flag=1&k-student.scorestudent.score|!flag&k-student.nump2-student.num) k=p2; if(k!=p1) t1=p1-student.score; p1-student.score=

14、k-student.score; k-student.score=t1; t2=p1-student.num; p1-student.num=k-student.num; k-student.num=t2; strcpy(s,p1-student.name); strcpy(p1-student.name,k-student.name); strcpy(k-student.name,s); 9.保存模块void Save(struct stud_type stu) /*保存模块*/ int i; FILE *fp1; /*指向文件的指针*/ stu0.jilu=r; if(fp1=fopen(

15、E:cj1.txt,wb)=NULL) /*打开文件,并判断打开是否正常,wb指只写打开或建立一个二进制文件,只允许写数据*/ printf(-打开文件失败!-nn); return; printf(开始存盘!n); for(i=0;ir;i+) if(fwrite(&stui,sizeof(struct stud_type),1,fp1)=0) printf(-数据存盘失败!-nn); fclose(fp1); printf(-存盘成功!-n); /*显示保存成功*/10.读入模块void duru(struct stud_type stu) /*数据读入模块*/ int i; FILE *

16、fp; /*指向文件的指针*/ if(fp=fopen(E:cj1.txt,rb)=NULL) /*打开文件,并判断打开是否正常,rb指读写打开一个二进制文件,允许读和写*/ printf(打开文件失败!n); return; printf(文件开始读取!n); rewind(fp); for(i=0;i=r;i+) fread(&stui,sizeof(struct stud_type),1,fp); r=stu0.jilu; printf(n文件成功读取!n); fclose(fp); r=stu0.jilu; 四,运行与测试报告五,设计体会通过这次的程序设计实习,自己编写程序,从上百个错

17、误慢慢的修改,经过自己的努力和老师的细心教导之下,错误逐渐的变少,最终可以运行了,这次的实习中,我磨练了自己的毅力和耐力,让我的信心倍增,在这短短的24的学时里,我体会到了苦与甜,更让我学到了很多的知识,在以后的工作中肯定会非常有用的,使对未来的生活充满了信心。附录:#include #include #include#include#define N 100typedef struct stud /学生信息结构 long num; char name20; float score; Stud;struct stud_type struct stud; char k3; int jilu; t

18、ypedef struct node Stud student; struct node *next; Node;struct stud_type stuN; Node *head=NULL; void read(void); void inser(long b); void print(); void find(long b); void searchname(char *s); Node * del(long n); void sort(int flag); void menu(); void Save(struct stud_type stu);void Print(struct stu

19、d_type stu);void duru(struct stud_type stu);int r=0;void main() char choose;duru(stu); /调用读入函数,读取文件信息; int flag=1; while (flag) menu(); /调用功能菜单函数,显示菜单项。 printf( 请选择:); choose=getchar(); switch(choose) case 1: read(); /调用建立链表的函数;输出链表信息; print(); printf(nPress any key Continue ); /getchar(); getchar()

20、; break; case 2: /调用按学号查找学生信息的函数;并输出查找结果信息; long c; printf(input the number you want to find:); scanf(%ld,&c); find(c); printf(nPress any key Continue.); getchar(); break; case 3: /调用按姓名查找学生信息的函数;并输出查找结果信息; char s20; printf(input the name you want to find:); scanf(%s,s); searchname(s); printf(n Pres

21、s any key Continue.); /getchar(); getchar(); break; case 4: /调用根据学号删除某个学生信息的函数;并输出删除后的链表信息; Node *h; long n; printf(input the number you want to delete:); scanf(%ld,&n); h=del(n); if(h=NULL) printf(No find the student n); else print(); printf(n Press any key Continue.); /getchar(); getchar(); break;

22、 case 5: /调用插入新的学生信息的函数;并输出插入后的链表信息; long a; printf(input the number for the new学号:n); scanf(%ld,&a); inser(a); print(); printf(n Press any key Continue.); /getchar(); getchar(); break; case 6: /调用按分数降序排序输出的函数;并输出排序后的链表信息; sort(1); print(); sort(0); printf(nPress any key Continue.); /getchar(); getc

23、har(); break;case 7: Save(stu); /调用保存函数,保存文件信息; print(); printf(nPress any key Continue ); /getchar(); getchar(); break; case 0: /结束程序运行! flag=0; printf(n * The End! *n); break; default: printf(n Wrong Selection !(选择错误,重选)n); getchar(); void menu() /综合作业功能菜单 printf( n 学 生 信 息 管 理 系 统n); printf( n 菜

24、单nn); printf( n 1. 数据录入 n); printf( n 2. 数据查询(学号)n); printf( n 3. 数据查询(姓名) n); printf( n 4. 数据删除n); printf( n 5. 数据插入n); printf( n 6. 数据排序n); printf( n 7. 保存文件信息 n);printf( n 0. 退 出nn); void read(void) long a; printf(学号:); scanf(%ld,&a); while(a0) inser(a); printf(学号:); scanf(%ld,&a); void inser(lon

25、g b) Node *last,*current,*p; current=head; while(current!=NULL&bcurrent-student.num) last=current; current=current-next; if(current=NULL|bstudent.num) printf(input the 姓名,学分:); p=(Node *)malloc(sizeof(Node); p-student.num=b; scanf(%s%f,p-student.name,&p-student.score);p-next=NULL; if(current=head) p

26、-next=head; head=p; Else p-next=current; last-next=p; else if(b=current-student.num) printf(error input a different number:); void print() Node *p=head; printf(学号 姓名 成绩:n); while(p!=NULL) printf(%ld %s %fn,p-student.num,p-student.name,p-student.score); p=p-next; void find(long b) Node *p=head; while

27、(p!=NULL&b!=p-student.num) p=p-next; if(!p) printf(No foundn); else printf(学号 姓名 成绩n); printf(%ld %s %fn,p-student.num,p-student.name,p-student.score); void searchname(char *s) Node *p=head; int flag=0; printf(学号 姓名 成绩:n); while(p!=NULL) if(strcmp(p-student.name,s)=0) printf(%ld %s %fn,p-student.num,p-student.name,p-s

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1