大学C++课程设计报告--学生成绩管理系统(附源代码) 下载本文

cout<<\┃\ curnode->ave_score(); cout<<\┃\ curnode->grade_score(); cout<<\┃\┃\ if(curnode->next!=NULL) cout<<\┣━━━━━╋━━━━━╋━━━╋━━━╋━━━╋━━━━╋━━━━╋━━┫\ else cout<<\┗━━━━━┻━━━━━┻━━━┻━━━┻━━━┻━━━━┻━━━━┻━━┛\ curnode=curnode->next; } curnode=pw; cout<<\┏━━━━━━━━━┓\ cout<<\┃!表中内容输出完毕!┃\ cout<<\┗━━━━━━━━━┛\ cout<<\}

////////////////////////////////////////输入数据 void student::cin_app() { student *p=curnode; bool b=0; string Number; string Name; double Computer; double ENglish; double Math; while(1) { cout<<\学 号:\ cin>>Number; curnode=head->next; while(curnode!=NULL) { b=(Number==curnode->number); curnode=curnode->next; } if(!b) break; else {

cout<<\┏━━━━━━━━━━━━━━┓\ cout<<\┃出现了相同的学号,请重新输入┃\ cout<<\┗━━━━━━━━━━━━━━┛\ } }

curnode=p;

cout<<\姓 名:\cin>>Name; while(1) { cout<<\计算机:\ cin>>Computer; while(cin.fail()) { err_char(); cout<<\计算机:\ cin>>Computer; } if(Computer>=0&&Computer<=100) break; else score_err(); }

while(1) { cout<<\英 语:\ cin>>ENglish; while(cin.fail()) { err_char(); cout<<\英 语:\ cin>>ENglish; } if(ENglish>=0&&ENglish<=100) break; else score_err(); }

while(1) { cout<<\数 学:\ cin>>Math; while(cin.fail()) {

err_char(); cout<<\数 学:\ cin>>Math; } if(Math>=0&&Math<=100) break; else score_err(); } this->app_score(Number,Name,Computer,ENglish,Math); cout<<\┏━━━━━━━━┓\ cout<<\┃!已添加一条记录!┃\ cout<<\┗━━━━━━━━┛\ cout<<\}

//////////////////////////////////////////查找函数的实现 void student::lookup(int n,string str) { student *p=curnode; bool b; //定义i=1,当找到数据时把i置为0.用于输出没有找到数据 int i=1; if(!(curnode=head->next)) { cout<<\┏━━━━━━━┓\ cout<<\┃!这是一个空表!┃\ cout<<\┗━━━━━━━┛\ curnode=p; cout<<\ return; } cout<<\┏━━━━━┳━━━━━┳━━━┳━━━┳━━━┳━━━━┳━━━━┳━━┓\ cout<<\┃ 学号 ┃ 姓名 ┃计算机┃ 英语 ┃ 数学 ┃ 总分 ┃ 平均分 ┃等级┃\ cout<<\┣━━━━━╋━━━━━╋━━━╋━━━╋━━━╋━━━━╋━━━━╋━━┫\ while(curnode!=NULL) { switch(n) { case 1: b=curnode->number==str;break; case 2: b=curnode->name==str;break;

default: return; } if(b) { i=0; cout<<\┃\ cout<<\┃\ cout<<\┃\ cout<<\┃\ cout<<\┃\ curnode->sum_score(); cout<<\┃\ curnode->ave_score(); cout<<\┃\ curnode->grade_score(); cout<<\┃\┃\ cout<<\┣━━━━━╋━━━━━╋━━━╋━━━╋━━━╋━━━━╋━━━━╋━━┫\ } curnode=curnode->next; } //当i=1是代表没有找到数据 if(i) { cout<<\┣━━━━━┻━━━━━┻━━━┻━━━┻━━━┻━━━━┻━━━━┻━━┫\ cout<<\┃没有匹配的数据 ┃\ cout<<\┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\ } else cout<<\┗━━━━━┻━━━━━┻━━━┻━━━┻━━━┻━━━━┻━━━━┻━━┛\ curnode=p; cout<<\以上是本次查找的结果!\ cout<<\}

//////////////////////////////////////////删除函数的实现 void student::del_score(int n,string str) { student *p=curnode,*pw=head; bool b;