教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 高中教育 >

C++学生成绩管理系统设计报告(3)

来源:网络收集 时间:2026-01-25
导读: cout物理\n; cout最高分:hi(4) 最低分:lo(4) 平均分:; av(4); ev(4); } double list::hi(int i) { high[i]=0.00; student *temp=first; while(temp!=0) {if(temp-outgrade(i)high[i]) high[i]=temp-outgrade(i); t

cout<<"物理\n";

cout<<"最高分:"<<hi(4)<<" "<<"最低分:"<<lo(4)<<" "<<"平均分:"; av(4); ev(4); }

double list::hi(int i) {

high[i]=0.00;

student *temp=first; while(temp!=0)

{if(temp->outgrade(i)>high[i]) high[i]=temp->outgrade(i); temp=temp->next; }

return high[i]; }

double list::lo(int i) {

low[i]=100;

student *temp=first;while(temp!=0) {if(temp->outgrade(i)<low[i]) low[i]=temp->outgrade(i); temp=temp->next; }

return low[i]; }

void list::av(int i) {

double aver=0;

student *temp=first; while(temp!=NULL) {

需求分析 功能描述 总体设计

aver+=temp->outgrade(i); temp=temp->next; }

cout<<aver/totoal<<endl; }

void list::ev(int i)

{ int a=0,b=0,c=0,d=0,e=0,f=0; student *temp=first;while(temp!=0) {switch((int)temp->outgrade(i)/10) {

case 10:a++;break;case 9:a++;break; case 8:b++;break;case 7:c++;break; case 6:d++;break;case 5:e++;break; default:f++; }

temp=temp->next; }

cout<<"100-90的人数:"<<a<<" 89-80的人数:"<<b<<" 79-70的人数:"<<c <<" 69-60的人数:"<<d<<" 59-50的人数:"<<e<<" 50以下的人数:"<<f <<" 及格的人数:"<<(a+b+c+d)<<" 不及格的人数:"<<(e+f)<<endl; }

void list::search(char s[10],int n) {

student *temp=first;for(;temp!=NULL;temp=temp->next) if(strcmp(temp->outname(),s)==0)temp->intgrade(n); }

void list::search1(char s[20],int n) {

student *temp=first;for(;temp!=NULL;temp=temp->next) if(strcmp(temp->outid(),s)==0)temp->intgrade(n); }

void list::outsum(char *n) {

if(first==0) {cout<<"无数据!"<<endl;return;}

student *temp=first;for(;temp!=NULL;temp=temp->next) if(strcmp(temp->outname(),n)==0) {

cout<<setw(8)<<"学号"<<setw(8)<<"姓名"<<setw(8)<<"性别"<<setw(8)<<"总成绩"<<

setw(10)<<"平均成绩"<<"\n";

需求分析 功能描述 总体设计

cout<<setw(8)<<temp->outid()<<setw(8)<<temp->outname()<<setw(8)

<<temp->outsex()<<setw(8)<<temp->outsum()<<setw(10)<<temp->outav(); return; }

cout<<"查无此人!"<<endl; return; }

void list::outsum1(char *n) {

double sum=0; int i=0; double av=0;

if(first==0) {cout<<"无数据!"<<endl;return;}

student *temp=first;for(;temp!=NULL;temp=temp->next) if(strcmp(temp->outid(),n)==0) {

cout<<setw(8)<<"学号"<<setw(8)<<"姓名"<<setw(8)<<"性别"<<setw(8)<<"总成绩"<<

setw(10)<<"平均成绩"<<"\n";

cout<<setw(8)<<temp->outid()<<setw(8)<<temp->outname()<<setw(8)

<<temp->outsex()<<setw(8)<<temp->outsum()<<setw(10)<<temp->outav(); return; }

cout<<"查无此人!"<<endl; return; }

void list::scanall() {

student *temp;

for(temp = first;temp!=NULL;temp=temp->next)

cout<<setw(8)<<temp->outid()<<setw(8)<<temp->outname()<<setw(6)

<<temp->outsex()<<setw(6)<<temp->outgrade(0)<<setw(6)<<temp->outgrade(1) <<setw(6)<<temp->outgrade(2)<<setw(14)<<temp->outgrade(3)<<setw(6)

<<temp->outgrade(4)<<setw(8)<<temp->outsum()<<setw(10)<<temp->outav()<<endl; }

…… 此处隐藏:301字,全部文档内容请下载后查看。喜欢就下载吧 ……
C++学生成绩管理系统设计报告(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/129565.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)