学生综合测评系统方案.docx
- 文档编号:1627195
- 上传时间:2022-10-23
- 格式:DOCX
- 页数:32
- 大小:21.33KB
学生综合测评系统方案.docx
《学生综合测评系统方案.docx》由会员分享,可在线阅读,更多相关《学生综合测评系统方案.docx(32页珍藏版)》请在冰豆网上搜索。
学生综合测评系统方案
#include
#include"stdlib.h"
#include"string.h"
#include
structstudent*Read();
voidsave(structstudent*head);
voidsinput(structstudent*p);
structstudent*input();
voidpaixu_num(structstudent*head);
structstudent*insert();
structstudent*alter();
structstudent*del();
voidfind_num(structstudent*phead);
voidfind_name(structstudent*phead);
voidoutput();
voidmin_student(structstudent*phead);
voidmax_student(structstudent*phead);
voidave_student(structstudent*phead);
voidevery_student(structstudent*phead);
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)"< 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){//数据存盘 FILE*fp; structstudent*p; p=head; cout<<"请输入你要存进去的文件(.dat)"< cin>>stu; if((fp=fopen(stu,"wb"))==NULL) { cout<<"无法打开文件! "< system("pause"); menu(); } while(p) { if(fwrite(p,Len,1,fp)! =1) { cout<<"写入数据出错"< fclose(fp); return; } else p=p->next; } cout<<"数据存入成功! 请按任意键继续! "< getchar(); fclose(fp); } //单次输入 voidsinput(structstudent*p) { cout<<"请输入学号: "< cin>>p->number; cout<<"请输入姓名: "< cin>>p->name; cout<<"请输入性别: "< cin>>p->sex; cout<<"请输入家庭住址: "< cin>>p->adds; cout<<"请输入联系电话: "< cin>>p->phone; cout<<"请输入qq: "< cin>>p->qq; cout<<"请输入语文成绩: "< cin>>p->chinese; if(p->chinese>100||p->chinese<0) { cout<<"成绩输入不符合规定,请重新输入: "< cin>>p->chinese; } cout<<"请输入数学成绩: "< cin>>p->math; if(p->math>100||p->math<0) { cout<<"成绩输入不符合规定,请重新输入: "< cin>>p->math; } cout<<"请输入英语成绩: "< cin>>p->english; if(p->english>100||p->english<0) { cout<<"成绩输入不符合规定,请重新输入: "< cin>>p->english; } cout<<"请输入同学互评分: "< cin>>p->txhp; if(p->txhp>100||p->txhp<0) { cout<<"成绩输入不符合规定,请重新输入: "< cin>>p->txhp; } cout<<"请输入品德成绩: "< cin>>p->pinde; if(p->pinde>100||p->pinde<0) { cout<<"成绩输入不符合规定,请重新输入: "< cin>>p->pinde; } cout<<"请输入任课教师评分: "< cin>>p->teacher; if(p->teacher>100||p->teacher<0) { cout<<"成绩输入不符合规定,请重新输入: "< cin>>p->teacher; } p->ave=(p->chinese+p->math+p->english)/3.0; p->zc=(p->ave*0.6+p->txhp*0.1+p->pinde*0.2+p->teacher*0.1); cout< cout<<"☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆"< cout<<"你刚输入的信息为: "< cout<<"\t\t学号: "< cout<<"\t\t姓名: "< cout<<"\t\t性别: "< cout<<"\t\t家庭住址: "< cout<<"\t\t联系电话: "< cout<<"\t\tQQ号: "< cout<<"\t\t语文成绩: "< cout<<"\t\t数学成绩: "< cout<<"\t\t英语成绩: "< cout<<"\t\t品德成绩: "< cout<<"\t\t教师评分: "< cout<<"☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆"< return; } //学生成绩录入函数 structstudent*input() { structstudent*head=NULL,*p1,*p2;//输入p1,p2链表最后节点 charch='y'; len=1; p2=p1=(structstudent*)malloc(sizeof(structstudent)); cout<<"请输入第"< "< sinput(p1); cout< cout<<"按n退出或按任意键继续"< cin>>ch; while (1) { if(len==1)//作为头结点 head=p1; else p2->next=p1; p2=p1; if(ch=='N'||ch=='n') break; p1=(structstudent*)malloc(sizeof(structstudent)); system("cls"); len++; cout<<"请输入第"< "< sinput(p1); cout< cout<<"按n退出或按任意键继续"< cin>>ch; } p2->next=NULL; paixu_num(head); cout<<"输入学生信息完成! 请按任意键返回主菜单! "< getchar(); returnhead; } //学号排序 voidpaixu_num(structstudent*head) { structstudentt,*r,*p,*q;//t交换p、q,r头结点 r=head; if(r==NULL) { cout<<"学生信息不存在,请先输入学生信息! "< return; } while(r) { p=r; q=r->next; while(q) { if(strcmp(q->number,p->number)<0)//q { 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->chinese; t.math=
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生 综合 测评 系统 方案