c语言程序设计课程学籍管理系统源代码Word文档格式.docx
《c语言程序设计课程学籍管理系统源代码Word文档格式.docx》由会员分享,可在线阅读,更多相关《c语言程序设计课程学籍管理系统源代码Word文档格式.docx(19页珍藏版)》请在冰豆网上搜索。
voidmainprint();
voidscoreprint();
voidstudentprint();
voidscoreInput();
voidscoreStat();
voidstudentStatus();
voidbukao();
/*生成并打印补考通知单*/
voidtuixue();
/*生成并打印退学通知单*/
voidxinmingdan();
/*生成并打印新名单*/
voidsortAnhao();
/*按学号排序*/
voidjisuanPingjun();
/*计算平均分并排序*/
voidtongjiFenshu();
/*统计分数段*/
voidfenxi();
/*分析学生成绩,算出不及格门数*/\
voidmynew();
/*创新功能*/
voidoutstudent();
voidoutdanke();
voidteshutuixue();
voidmain()
charchoose='
\0'
yes_no='
;
do
{
system("
color4f"
);
cls"
mainprint();
printf("
"
choose=getche();
switch(choose)
{
case'
1'
:
scoreInput();
break;
/*成绩录入*/
2'
scoreStat();
3'
studentStatus();
4'
mynew();
0'
default:
printf("
\n%c是非法选项!
\n"
break;
}
if(choose=='
)break;
\n即将进入主菜单,要继续选择吗(Y/N)?
do
yes_no=getche();
}while(yes_no!
='
Y'
&
yes_no!
y'
N'
n'
}while(yes_no=='
||yes_no=='
}
voidmainprint()
{printf("
|******************************************|\n"
printf("
|欢迎使用学籍管理系统|\n"
|请输入选项编号(0~4)|\n"
|------------------------------------------|\n"
|1--录入成绩|\n"
|2--统计成绩|\n"
|3--处理学籍|\n"
|4--创新功能|\n"
|0--退出|\n"
voidscoreInput()
{inti=0;
charyes_no='
structstudentex1[N]={0};
FILE*fp=NULL;
system("
color5f"
fp=fopen("
d:
\\学生基本信息.txt"
"
w"
if(fp==NULL)
{printf("
\n打开文件失败!
return;
}
\n欢迎进入成绩录入系统\n"
\n请输入第%d个记录:
i+1);
\n输入学生学号:
(用#结束程序)"
scanf("
%s"
ex1[i].num);
\n输入学生姓名:
ex1[i].name);
\n请依次输入学生的数学、英语、c编程、电路设计和法律基础的成绩:
%f%f%f%f%f"
&
ex1[i].math,&
ex1[i].english,&
ex1[i].cprogram,&
ex1[i].circuit,&
ex1[i].law);
while(ex1[i].num[0]!
#'
ex1[i].name[0]!
)
{fprintf(fp,"
%3d%15s%16s%7.1f%7.1f%7.1f%7.1f%7.1f\n"
i,ex1[i].num,ex1[i].name,ex1[i].math,ex1[i].english,ex1[i].cprogram,ex1[i].circuit,ex1[i].law);
i++;
scanf("
fclose(fp);
voidscoreStat()
{charchoose='
color9f"
\n欢迎选择成绩统计系统\n"
/*显示菜单*/
\n|------------------------|"
\n|请输入选项编号(0~4)|"
\n|1--按学号排序|"
\n|2--按平均分数排序|"
\n|3--统计分数段|"
\n|4--返回|"
\n|0--退出系统|"
\n|------------------------|\n"
choose=getch();
sortAnhao();
jisuanPingjun();
tongjiFenshu();
main();
\n要继续选择吗(Y/N)?
{yes_no=getche();
voidsortAnhao()
{inti=0,j=0,n=0;
structstudentex2[N]={0},temp={0};
r"
\n欢迎进入按学号排序系统\n"
while(feof(fp)==0)
{fscanf(fp,"
%3d%15s%16s%f%f%f%f%f\n"
i,&
ex2[i].num,ex2[i].name,&
ex2[i].math,&
ex2[i].english,&
ex2[i].cprogram,&
ex2[i].circuit,&
ex2[i].law);
n++;
for(i=0;
i<
n-1;
i++)
for(j=i+1;
j<
n;
j++)
if(strcmp(ex2[i].num,ex2[j].num)>
0)
{temp=ex2[i];
ex2[i]=ex2[j];
ex2[j]=temp;
}
\\按学号排序.txt"
fprintf(fp,"
序号学号姓名高数英语编程电路法律\n"
i++)fprintf(fp,"
i,ex2[i].num,ex2[i].name,ex2[i].math,ex2[i].english,ex2[i].cprogram,ex2[i].circuit,ex2[i].law);
\n文件已保存至D:
\\按学号排序.txt\n"
voidjisuanPingjun()
{inti=0,j=0,n=0;
charc='
\n欢迎使用按学号排序系统\n"
i,ex2[i