资源描述:
《学生选修课程系统设计要求》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、学生选修课程系统设计#include#includestructcourse{intnum;charname[15];charxingzhi[10];inttime;intttime;intetime;intmark;intterm;};structstudent{intsnum;intcnum;};/*insert*/voidinsert(){voidmenu();FILE*fp;structcoursec;if((fp=fopen("course.txt","a+"))==NULL
2、){printf("cannotopenfile");}printf("t请输入课程信息:");printf("t输入课程编号,课程名称,课程性质,总学时,授课时间,实验或上机学时,开课学期:");scanf("%d%s%s%d%d%d%d%d",&c.num,&c.name,&c.xingzhi,&c.time,&c.ttime,&c.etime,&c.mark,&c.term);fprintf(fp,"%d%s%s%d%d%d%d%d",c.num,c.name,c.xingzhi,c.time,c
3、.ttime,c.etime,c.mark,c.term);fclose(fp);menu();}/*browseliu_lan*/voidbrowser(){voidmenu();FILE*fp;structcoursec;if((fp=fopen("course.txt","r"))==NULL){printf("Cannotopencourse!");}for(;!feof(fp);){fscanf(fp,"%d%s%s%d%d%d%d%d",&c.num,&c.name,&c.xingzhi,&c.time
4、,&c.ttime,&c.etime,&c.mark,&c.term);printf("%d%s%s%d%d%d%d%d",c.num,c.name,c.xingzhi,c.time,c.ttime,c.etime,c.mark,c.term);}fclose(fp);menu();}/*search*/voidsearch(){voidmenu();FILE*fp;structcoursec;intscore;printf("inputmarkyourwanttosearch:");scanf("%d",&score
5、);if((fp=fopen("course.txt","r"))==NULL){printf("Cannotopencourse!");}for(;!feof(fp);){fscanf(fp,"%d%s%s%d%d%d%d%d",&c.num,&c.name,&c.xingzhi,&c.time,&c.ttime,&c.etime,&c.mark,&c.term);if(c.mark==score)printf("%d%s%s%d%d%d%d%d",c.num,c.name,c.xingzhi,c.time,c.
6、ttime,c.etime,c.mark,c.term);}fclose(fp);menu();}/*tongjixuankerenshu*/voidxuanke_information(){voidmenu();inttotal=0;FILE*fp;structstudentc;intnum;printf("inputcourse-numberyourwanttosearch:");scanf("%d",&num);if((fp=fopen("student.txt","r"))==NULL){printf("C
7、annotopenstudent!");}for(;!feof(fp);){fscanf(fp,"%d%d",&c.snum,&c.cnum);if(c.cnum==num){total++;printf("student_num=%d,course_num=%d",c.snum,c.cnum);}}fclose(fp);printf("Thenumberchoosecourse_num%dis%d!",num,total);menu();}/*xuanke*/voidxuan_ke(){voidmenu();in
8、tsnum,cnum;FILE*fp;printf("Pleaseinputyourstudent_numberandcoursenumberyouwanttochoose:");scanf("%d%d",&snum,&cnum);if((fp=fopen("student.txt","a+"))=