C语言专业课程设计学生综合测评系统文档格式.docx
《C语言专业课程设计学生综合测评系统文档格式.docx》由会员分享,可在线阅读,更多相关《C语言专业课程设计学生综合测评系统文档格式.docx(18页珍藏版)》请在冰豆网上搜索。
(3)删除同学信息:
输入将删除同学号,读出该同学信息,要求对此进行确认,以决定是否删除将删除后的信息写到文件中。
(4)浏览学生信息:
提示:
打开文件,显示该文件的学生信息。
B、学生数据处理:
(1)按考试科目录入学生成绩并且按公式:
考试成绩=(语文+数学+外语)/3计算考试成绩,并计算考试名次,提示:
先把学生信息读入数组,然后按提示输入每科成绩,计算考试成绩,求出名次,最后把学生记录写入一个文件中。
(2)学生测评数据输入并计算综合测评总分及名次。
综合测评总分=(考试成绩)*+(同学互评分)*+品德成绩*+任课老师评分*。
(3)学生数据管理
输入学号,读出并显示该同学信息,输入新数据,将改后信息写入文件
(4)学生数据查询:
输入学号或其他信息,即读出所有数据信息,并显示出来。
C、学生综合信息输出
输出学生信息到屏幕。
三、算法提示:
1、数据结构:
结构体类型数组
2、数据库结构:
下表构成该系统的基本数据库。
学号
姓名
考试成绩
…
评分
Char
struct
int
二.总体设计方案
三.程序源代码
#include<
>
#defineN100
voidinit();
charwelcome();
voidInputInfo();
voidview();
voidxiugai();
voidDeleteInfo();
voidpaiming1(structstudent_infostudent[]);
voidpaiming2(structstudent_infostudent[]);
voidViewAll();
voidclean();
voidPaimingView();
voidexits();
structstudent_infoinput();
voidSortInfo(structstudent_infostudent[]);
voidViewInfo(structstudent_info*sp);
voidSaveStruct(structstudent_info*sp,intsize,intn,charfilename[20]);
voidLoadStruct(structstudent_info*sp,intsize,intn,charfilename[20]);
voidSaveInt(int*p,intsize,intn,charfilename[20]);
voidLoadInt(int*p,intsize,intn,charfilename[20]);
intNumExist(structstudent_infostudent[],intnum);
structstudent_info
{
intnum;
//学号
charname[6];
//姓名
charsex[5];
//性别
charadress[20];
//家庭住址
chartel[10];
//电话
intchinese,math,english,huping,pingde,jiaoping,paiming1,paiming2;
//语文数学英语互评品德教评
doubleave,zhongping;
structstudent_infostudent[N];
intcounter,PM;
voidmain()
{
charselect;
init();
//调用初始化函数
while
(1)
{
select=welcome();
switch(select)
{
case'
1'
:
system("
cls"
);
InputInfo();
break;
//选项1:
输入学生信息
2'
view();
//选项2:
浏览学生信息
3'
xiugai();
//选项3:
修改学生信息
4'
DeleteInfo();
//选项4:
删除学生信息
5'
paiming1(student);
paiming2(student);
PM=1;
getchar();
//选项5:
学生信息排名
6'
ViewAll();
break;
//选项6:
浏览全部学生信息
7'
clean();
//选项7:
清除所有信息
8'
PaimingView();
//选项8:
查询排名
0'
exits();
//选项9:
退出
}
}
}
voidinit()
FILE*fp;
fp=fopen("
"
"
rb"
//打开计数变量counter文件
if(fp!
=NULL)//载入counter
fclose(fp);
LoadInt(&
counter,sizeof(counter),1,"
else
fp=fopen("
wb"
//若没有counter文件,则创建一个,counter初始为0。
counter=0;
if(counter!
=0)//载入学生数据
LoadStruct(student,sizeof(structstudent_info),counter,"
charwelcome()
system("
printf("
\t\t欢迎使用学生信息管理系统\n"
\n"
\n\n"
输入相应的功能序号:
select=getchar();
if(select=='
||select=='
)
returnselect;
continue;
voidInputInfo()
inti,n;
printf("
需要录入多少位学生的信息:
scanf("
%d"
&
n);
for(i=1;
i<
=n;
i++)
student[counter]=input();
counter++;
PM=0;
SortInfo(student);
SaveStruct(student,sizeof(structstudent_info),counter,"
SaveInt(&
voidview()
inti,num;
请输入需要游览的学生信息的学号:
scanf("
num);
getchar();
if((i=NumExist(student,num))==-1)
printf("
不存在该学号,按回车键返回..."
getchar();
system("
return;
ViewInfo(&
student[i]);
\n按回车键返回..."
return;
voidxiugai()
charYN,select;
请输入需要修改的学生信息的学号:
getchar();
if((i=NumExist(student,num))==-1)
ViewInfo(&
是否要修改?
(Y/N):
%c"
YN);
if(YN!
='
Y'
&
YN!
y'
修改取消."
\n"
scanf(