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

上传人:b****5 文档编号:18214825 上传时间:2022-12-14 格式:DOCX 页数:32 大小:20.83KB
下载 相关 举报
学生综合测评系统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

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=q->

t.english=q->

t.txhp=q->

t.pinde=q->

t.teacher=q->

strcpy(q->

name,p->

sex,p->

adds,p->

phone,p->

qq,p->

q->

chinese=p->

math=p->

english=p->

txhp=p->

pinde=p->

teacher=p->

strcpy(p->

number,t.number);

name,t.name);

sex,t.sex);

adds,t.adds);

phone,t.phone);

qq,t.qq);

p->

chinese=t.chinese;

p->

math=t.math;

english=t.english;

txhp=t.txhp;

pinde=t.pinde;

teacher=t.teacher;

}

q=q->

}

r=r->

//插入函数

structstudent*insert(){

structstudent*p,*p1,*head;

head=Read();

p1=head;

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

charnum[14],ch;

请输入你要插入的前一个学生的学号:

num;

while(p1){

if(!

strcmp(p1->

number,num)){

sinput(p);

next=p1->

p1->

next=p;

len++;

p1=p1->

if(ch=='

学生信息插入成功!

请按任意键返回!

//修改学生信息

structstudent*alter()

chartemp[13];

structstudent*p,*head;

请输入要修改学生的学号:

temp;

while(p)

strcmp(p->

number,temp))

学生信息修改成功!

system("

returnhead;

//删除学生信息

structstudent*del()

chartemp[13];

intm=0;

structstudent*p1,*p,*head;

//p1删除

p1=p=head;

请输入你要删除学生的学号:

while(p){

if(strcmp(p1->

number,temp)==0)

if(p1==head)//删除的头结点

head=p1->

else

len--;

m=1;

学生信息删除成功!

请按任意键返回主菜单......."

getchar();

returnhead;

if(!

m)

查找不到这个信息!

voidfind_num(structstudent*head)//按学号查找

structstudent*p=head;

chartemp[9];

intm=0;

请输入要查找的学生的学号"

while(p!

=NULL)

if(strcmp(p->

number,temp)==0)

该学生的具体信息为:

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

\t\t数学成绩"

\t\t英语成绩"

\t\t平均成绩"

ave<

\t\t品德成绩"

\t\t老师评分"

\t\t综合成绩"

zc<

score_paixu(head);

\t\t考试名次"

ksmc<

\t\t综测名次"

zcmc<

m=1;

p=p->

//继续向下寻找

查找不到这个学号的信息!

按任意键返回主菜单……"

return;

voidfind_name(structstudent*head)//按姓名查找

structstudent*p=head;

请输入要查找的学生的姓名"

while(p)

if(strcmp(p->

name,temp)==0)

学号:

voidoutput()

inti=1;

\t\t老师评分:

\t\t平均成绩:

\t\t综合成绩:

\t\t综合测评名次"

p=p->

i++;

请按任意键返回主菜单……"

voidmax_student(structstudent*head){

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

当前位置:首页 > 工程科技 > 城乡园林规划

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

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