学生综合测评系统方案Word文档格式.docx

上传人:b****2 文档编号:14549810 上传时间:2022-10-23 格式:DOCX 页数:32 大小:21.33KB
下载 相关 举报
学生综合测评系统方案Word文档格式.docx_第1页
第1页 / 共32页
学生综合测评系统方案Word文档格式.docx_第2页
第2页 / 共32页
学生综合测评系统方案Word文档格式.docx_第3页
第3页 / 共32页
学生综合测评系统方案Word文档格式.docx_第4页
第4页 / 共32页
学生综合测评系统方案Word文档格式.docx_第5页
第5页 / 共32页
点击查看更多>>
下载资源
资源描述

学生综合测评系统方案Word文档格式.docx

《学生综合测评系统方案Word文档格式.docx》由会员分享,可在线阅读,更多相关《学生综合测评系统方案Word文档格式.docx(32页珍藏版)》请在冰豆网上搜索。

学生综合测评系统方案Word文档格式.docx

voidscore_paixu(structstudent*head);

voidhelp();

voidtj_menu(structstudent*head);

voidfind_menu(structstudent*head);

voidmenu();

structstudent{//定义学生信息结构数组,用于学生信息输入

charnumber[13];

charname[13];

charsex[4];

charadds[15];

charphone[14];

charqq[14];

floatchinese,math,english,txhp,pinde,teacher;

intzcmc,ksmc;

doubleave,zc;

structstudent*next;

};

#defineLensizeof(structstudent)

intlen;

//链表长度

inta=0,b=0,c=0,d=0,e=0;

//用来存放成绩各阶的人数

charstu[10];

structstudent*Read(){//读取数据文件保存到链表中,返回指向此链表头指针

structstudent*head=NULL;

structstudent*p1,*p2;

FILE*fp;

cout<

<

"

请输入你要打开的文件(.dat)"

endl;

cin>

>

stu;

if((fp=fopen(stu,"

rb+"

))==NULL)

{

cout<

打开文件出错!

exit(0);

}

while(!

feof(fp)){

if((p1=(structstudent*)malloc(Len))==NULL)

{

cout<

内存申请出错"

fclose(fp);

exit(0);

}

if(fread(p1,Len,1,fp)!

=1)

free(p1);

break;

if(head==NULL)

head=p2=p1;

else

p2->

next=p1;

p2=p1;

fclose(fp);

returnhead;

}

voidsave(structstudent*head){//数据存盘

structstudent*p;

p=head;

请输入你要存进去的文件(.dat)"

if((fp=fopen(stu,"

wb"

无法打开文件!

system("

pause"

);

menu();

while(p)

if(fwrite(p,Len,1,fp)!

写入数据出错"

return;

p=p->

next;

数据存入成功!

请按任意键继续!

getchar();

//单次输入

voidsinput(structstudent*p)

{

cout<

请输入学号:

cin>

p->

number;

请输入姓名:

"

name;

请输入性别:

sex;

请输入家庭住址:

adds;

请输入联系电话:

phone;

请输入qq:

qq;

请输入语文成绩:

chinese;

if(p->

chinese>

100||p->

chinese<

0)

成绩输入不符合规定,请重新输入:

请输入数学成绩:

math;

math>

math<

请输入英语成绩:

english;

english>

english<

请输入同学互评分:

txhp;

txhp>

txhp<

请输入品德成绩:

pinde;

pinde>

pinde<

请输入任课教师评分:

teacher;

teacher>

teacher<

ave=(p->

chinese+p->

math+p->

english)/3.0;

zc=(p->

ave*0.6+p->

txhp*0.1+p->

pinde*0.2+p->

teacher*0.1);

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆"

你刚输入的信息为:

\t\t学号:

number<

\t\t姓名:

name<

\t\t性别:

sex<

\t\t家庭住址:

adds<

\t\t联系电话:

phone<

\t\tQQ号:

qq<

\t\t语文成绩:

\t\t数学成绩:

\t\t英语成绩:

\t\t品德成绩:

\t\t教师评分:

return;

//学生成绩录入函数

structstudent*input()

structstudent*head=NULL,*p1,*p2;

//输入p1,p2链表最后节点

charch='

y'

;

len=1;

p2=p1=(structstudent*)malloc(sizeof(structstudent));

请输入第"

len<

个学生的信息:

sinput(p1);

按n退出或按任意键继续"

ch;

while

(1)

if(len==1)//作为头结点

head=p1;

else

p2=p1;

if(ch=='

N'

||ch=='

n'

p1=(structstudent*)malloc(sizeof(structstudent));

cls"

len++;

sinput(p1);

}

p2->

next=NULL;

paixu_num(head);

输入学生信息完成!

请按任意键返回主菜单!

//学号排序

voidpaixu_num(structstudent*head)

{

structstudentt,*r,*p,*q;

//t交换p、q,r头结点

r=head;

if(r==NULL)

{

学生信息不存在,请先输入学生信息!

return;

while(r)

p=r;

q=r->

while(q)

{

if(strcmp(q->

number,p->

number)<

0)//q<

p

{

strcpy(t.number,q->

number);

strcpy(t.name,q->

name);

strcpy(t.sex,q->

sex);

strcpy(t.adds,q->

adds);

strcpy(t.phone,q->

phone);

strcpy(t.qq,q->

qq);

t.chinese=q->

t.math=

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 求职职场 > 自我管理与提升

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1