C++学生成绩管理系统设计报告(3)
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字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [高中教育]电子线路高频非线性部分2.1
- [高中教育]中班美术活动——我的小手
- [高中教育]常用三极管参数大全
- [高中教育]计算机常见故障及解决办法
- [高中教育]风机基础环水平度控制方法探讨
- [高中教育]机械安全工程(专升本)阶段性作业3
- [高中教育]2009年安徽省高考语文考试说明刍议
- [高中教育]unit5 let's eat公开课教案设
- [高中教育]计算机网络原理课后习题答案
- [高中教育]2016-2022年中国新能源市场研究与投资
- [高中教育]2015-2020年中国会议行业市场评估及投
- [高中教育]经销商大会峰会主持人串词开场白
- [高中教育]2014新版北师大数学三年级上册小熊购物
- [高中教育]七年级第一学期体育与健康全套教案
- [高中教育]第三章:国际金融市场
- [高中教育]六年级下册数学单元测试-2.比例 北师大
- [高中教育]2016年上海海事大学法学院624刑法之《
- [高中教育]中国碳化钙产业竞争现状及未来五年投资
- [高中教育]网络时代,我们怎么玩
- [高中教育]圆锥曲线——高中数学基础知识与典型例
- 高集医院世界艾滋病宣传日活动方案
- 苏教版六年级英语上册期末试卷含答案
- 全民枪战生化英雄模式幽灵怎么玩 生化
- 灿烂的宋元文化一导学案
- 第2章货币资金与应收款项
- 北师大版八年级下册数学第三章《分式》
- 浅析高分子材料成型加工技术
- 华南理工大学2013年度共青团先进集体及
- 教师资格科目二小学教案模板(共合集)
- 工程扩建可研报告
- 中华人民共和国海事局2014年度招录公务
- 提高农村小学生作文能力的教学尝试
- 徒手心肺复苏术操作步骤
- 毛概试题库7-15章
- 2014-2015学年度(上)初中班主任工作计
- 企业驾驶员安全生产责任书
- 第07章 不等式测试题-2016年高考文科数
- 医疗器械经营企业工作程序
- 考研英语必背36篇_彩版_精华
- 初中9月13-15假期作业 (1)




