学生选课系统及学籍管理系统

学生选课系统及学籍管理系统

ID:33413327

大小:96.97 KB

页数:16页

时间:2019-02-25

学生选课系统及学籍管理系统_第1页
学生选课系统及学籍管理系统_第2页
学生选课系统及学籍管理系统_第3页
学生选课系统及学籍管理系统_第4页
学生选课系统及学籍管理系统_第5页
资源描述:

《学生选课系统及学籍管理系统》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、实用标准综合设计题目:学籍管理及选课系统课程名称:C语言高级程序及设计学院:自动化专业班级:12电力4班学号:姓名:郑程鹏联系方式:任课老师:王星华2014年12月3日文案大全实用标准#include#include#includeintcourcenum,studentnum;//课程的结构体structcource{intnum,credit,maxnum,selectednum;charcourceName[30];structcource*next;}cource;//学生的结构体structstudent

2、{charstudentname[20];intselectednum,selectedcredit,num;intcource[10];structstudent*next;}student;//指针链表的头structcource*courcehead;structstudent*studenthead;intj;voidmain(){voidgetcource();voidgetstudent();inti;//作为获取用户的输入的变量getcource();//从文件中读取已保存的课程数据getstudent();//从文件中读取已保存的学生数据system("c

3、ls");run:for(j=0;j<80;j++)printf("*");printf("1.查看课程");printf("2.查看管理学生");printf("3.查看选课");printf("4.选课情况");printf("5.退出系统");for(j=0;j<80;j++)printf("*");printf("请输入您的选择:");文案大全实用标准scanf("%d",&i);if(i<1

4、

5、i>5){printf("输入有误");gotorun;}if(i==1){system("cls");//清屏函数,清楚屏幕所有的东西vie

6、wcource();//查看课程的函数gotorun;}elseif(i==2){system("cls");manage();//管理学生的函数gotorun;}elseif(i==3){system("cls");xuankecaidan();//选课的函数gotorun;}elseif(i==4){system("cls");sortstudent();//查看选课情况的函数gotorun;}elseif(i==5){system("cls");}}voidgetcource(){FILE*fp;structcource*p1,*p2;courcenum=0;cha

7、rfilepath[]="cource.txt";//默认txt文件在当前目录下文案大全实用标准if((fp=fopen(filepath,"r"))==NULL)//以只读的方式打开文件{//无法打开文件的时候printf("errortofindcourcefile%s!",filepath);exit(0);}//生成structcource大小的内存并让p1,p2指向p1=p2=(structcource*)malloc(sizeof(structcource));//从文件中读取fscanf(fp,"%d%s%d%d%d",&p1->num,p1->cour

8、ceName,&p1->credit,&p1->maxnum,&p1->selectednum);courcehead=NULL;while(!feof(fp))//循环读取直到读到文件结尾{courcenum=courcenum+1;//读取第一个课程的时候情况不同if(courcenum==1)courcehead=p1;elsep2->next=p1;p2=p1;p1=(structcource*)malloc(sizeof(structcource));fscanf(fp,"%d%s%d%d%d",&p1->num,p1->courceName,&p1->cred

9、it,&p1->maxnum,&p1->selectednum);}p2->next=NULL;}voidgetstudent(){charbianhao[20];char*fgzf=";";char*cba;inti;FILE*fp;structstudent*p1,*p2;courcenum=0;charfilepath[]="student.txt";if((fp=fopen(filepath,"r"))==NULL){printf("errortofindstudentfile%s!",filepath);exit

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。