学籍信息管理系统设计源代码内容摘要:

/*未查到相应记录,询问是否继续查找 */ scanf(%d,amp。 c)。 switch(c) { case 1:search_num()。 break。 /*继续按此方式查找 */ default:printf(\n继续查找 ...)。 } } else { printf(\n学生信息查询结束 . Press any key to continue . . .)。 getch()。 } } /*按姓名查找学生信息 */ void search_name() { int i,c,sn1=0。 char n2[20]。 printf(\n输入要查询学生的名字 : )。 scanf(%s,amp。 n2)。 for(i=0。 istumax。 i++) if(strcmp(stu[i].name,n2)==0) { printf_one_stu(i)。 /*显示查到的记录 */ sn1++。 } if(sn1==0) { printf(\n此学生不存在 !\n查询下一个学生 ? 1) 是 2) 否 [ ]\b\b)。 /*未查到相应记录,询问是否继续查找 */ scanf(%d,amp。 c)。 switch(c) { case 1:search_name()。 break。 /*继续按此方式查找 */ default:printf(\n继续查询 ...)。 } } else { printf(\n查询结束 . Press any key to continue . . .)。 getch()。 } } /*按宿舍查找学生信息 */ void search_room() { int i,c,r,sr1=0。 printf(\n输入要查询学生的宿舍号码 : )。 scanf(%d,amp。 r)。 for(i=0。 istumax。 i++) if(stu[i].room==r) { printf_one_stu(i)。 /*显示查到 的记录 */ sr1++。 } if(sr1==0) { printf(\n这个宿舍号码不存在 !\n查询下一个宿舍号码 ? 1)是 2)否 [ ]\b\b)。 /*未查到相应记录,询问是否继续查找 */ scanf(%d,amp。 c)。 switch(c) { case 1:search_room()。 break。 /*继续按此方式查找 */ default:printf(\n继续查询 ...)。 } } else { printf(\n查询结束 . Press any key to continue . . .)。 getch()。 } } /*按学号查找学生成绩 */ void search_score() { int i,a,s1。 char n3[9]。 printf(\n输入要查询成绩的学生的学号 : )。 scanf(%s,n3)。 printf_onestu_score(n3)。 /*显示查到的记录 */ printf(\n查询结束 . \n 是否查询其他学生 ? 1)是 2)否 [ ]\b\b)。 /*询问是否继续查找 */ scanf(%d,amp。 s1)。 switch(s1) { case 1:search_score()。 break。 /*继续按此方式查找 */ default:printf(\n查询结束 . Press any key to continue . . .)。 getch()。 } } /*显示一个学生的所有分数 */ void printf_onestu_score(char snum[]) { int i,j,k=0,a1。 float gp=0。 for(j=0。 jstumax。 j++) if(strcmp(snum,stu[j].num)==0) { printf(\n学号 : %s 姓名 :%s,stu[j].num,stu[j].name)。 printf(\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^)。 break。 } if(j==stumax) printf(\n此学生不存在 !)。 else { for(i=0。 iscoremax。 i++) if(strcmp(score[i].num,snum)==0) /*显示该学生的所有成绩 */ { printf_one_score(i)。 k++。 gp+=score[i].getpoint。 } printf(\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^)。 printf(\n共修 : %d 科 实得总学分 : %\n,k,gp)。 printf(\n 此 学 生 成 绩 显 示 完 毕 . Press any key to continue . . .)。 getch()。 } } /*删除 */ void delete_one() { int i,j,sd1=0,sd2,sd3。 char c[9]。 printf(\n你要删除哪位同学的信息记录 ? \n请输入他的学号 :)。 scanf(%s,c)。 /*输入要删除的学号 */ for(i=0。 istumax。 i++) if(strcmp(stu[i].num,c)==0) break。 if(i==stumax) /*未找到学生 */ printf(\n未找到该学生 !)。 else /*找到学生 */ { printf_one_stu(i)。 /*显示学生基本信息记录 */ printf(\n要删除这些信息么 ? 1)是 2)否并返回 [ ]\b\b)。 scanf(%d,amp。 sd2)。 /*删除确认。 */ if(sd2==1) /*确认 */ { stu[i]=stu[stumax1]。 /*删除该学生基本信息 */ stumax。 printf(\n删除学生信息成功 !\n)。 save()。 /*调用保存学生基本信息函数 */ for(j=0。 jscoremax。 j++) /*删除该学生的成绩信息 */ if(strcmp(score[j].num,c)==0) { delete_one_score(j)。 /*调用删除成绩函数 */ sd1++。 } if(sd1==0) printf(\n该学生无成绩记录 .)。 /*该学生无成绩记录 */ printf(\n删除信息成功 .)。 } } printf(\n删除其他学生的成绩 ? 1)是 2)否 [ ]\b\b)。 /*是否继续删除 */ scanf(%d,amp。 sd3)。 switch(sd3) { case 1:delete_one()。 break。 /*继续删除 */ default: printf(\n 查 询 学 生 的 号 码 结 束 . Press any key to continue . . .)。 getch()。 menu()。 } } /*********排序 *********/ void order() { int c。 printf(排序中 ...\n按什么排序 : 1)课程编号 2)课程 [ ]\b\b)。 scanf(%d,amp。 c)。 /*指定按什么排序 */ switch(c) { case 1:order_course_num()。 printf(\n 排序结束 . Press any key to continue . . .)。 break。 /*选择按课程编号排序 */ case 2:order_course()。 printf(\n 排 序 结 束 . Press any key to continue . . .)。 break。 /*选择按课程名称排序 */ default:printf(\n输入错误 . 请重新输入 (1~2)!\n)。 order()。 } getch()。 menu()。 } /*按课程编号排序 */ void order_course_num() { int i,j,k=0。 char um[10]。 struct stuscore sco。 printf(\n输入要排序的课程编号 :)。 scanf(%s,um)。 /*输入要排序的课程编号 */ for(i=0。 iscoremax。 i++) if(strcmp(score[i].coursenum,um)==0) /*查找对应信息并保存在 score1[M]中 */ { score1[k]=score[i]。 /* score1[M]为全局数组 */ k++。 } for(i=0。 ik1。 i++) for(j=i+1。 jk。 j++) { if(score1[i].scorescore1[j].score) /*升序排序 */ { sco=score1[i]。 score1[i]=score1[j]。 score1[j]=sco。 } } order_printf(k)。 /*调用显示函数 */。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。