#include<iostream>
using namespace std;
class student{
public:
int Input()
{
for(i=;i<;i++)
{
cout<<"Please Input "<<i+<<" Student's Number And Scores:"<<endl;
cin>>number[i];
for(j=;j<;j++)
cin>>score[i][j];
}
return ;
} int calculateall()
{
for(i=;i<;i++)
{
ave[i]=;
for(j=;j<;j++)
ave[i]=ave[i]+score[i][j];
ave[i]=ave[i]/5.0;
} return ;
}
int calculateone(int n)
{
average=;
for(i=;i<;i++)
average+=score[i][n];
return average/5.0;
}
int Output()
{
calculateall();
for(i=;i<;i++)
{
cout<<"The number is "<<number[i]<<endl;
for(j=;j<;j++)
cout<<score[i][j]<<" ";
cout<<endl;
cout<<"The average is "<<ave[i]<<endl;
}
return ;
}
private:
char number[][];
double score[][];
double ave[];
double average;
int i;
int j;
}; int main()
{
int n;
class student stu1;
stu1.Input();
stu1.Output();
cout<<"Please input the number of the class which you want calculate(0,1,2,3,4):"<<endl;
cin>>n;
cout<<"The class's average is: "<<stu1.calculateone(n)<<endl;
return ;
}

score的更多相关文章

  1. Lucene的评分(score)机制研究

    首先,需要学习Lucene的评分计算公式—— 分值计算方式为查询语句q中每个项t与文档d的匹配分值之和,当然还有权重的因素.其中每一项的意思如下表所示: 表3.5 评分公式中的因子 评分因子 描 述 ...

  2. 设有一数据库,包括四个表:学生表(Student)、课程表(Course)、成绩表(Score)以及教师信息表(Teacher)。

    一.            设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表(一)~表( ...

  3. 关于一道数据库例题的解析。为什么σ age>22 (πS_ID,SCORE (SC) ) 选项是错的?

    本人大二学子.近段时间在做数据库复习题的时候遇到一道题,如下. 有关系SC(S_ID,C_ID,AGE,SCORE),查找年龄大于22岁的学生的学号和分数,正确的关系代数表达式是( ) . ⅰ. πS ...

  4. 利用SCORE法则来总结一次偷懒的单元测试过程

    最近遇到一个单元测试的问题,本周正好学个了一个SCORE法则,这里正好练练手应用此法则将问题的前因后果分享给大家. S:背景  代码要有单元测试,检测的标准就是统计代码的单元测试覆盖率,程序员需要达到 ...

  5. Hiho coder 1236 2015 北京网络赛 Score

    五维偏序..一开始被吓到了,后来知道了一种BITSET分块的方法,感觉非常不错. 呆马: #include <iostream> #include <cstdio> #incl ...

  6. Java-集合-第三题 有如下Student 对象, private String name; private int age; private int score; private String classNum; 其中,classNum 表示学生的班号,例如“class05”。 有如下List List list = new ArrayList(); l

    第三题 有如下Student 对象, private String name; private int age; private int score; private String classNum; ...

  7. 第三题 有如下Student 对象, private String name; private int age; private int score; private String classNum; 其中,classNum 表示学生的班号,例如“class05”。 有如下List List list = new ArrayList();

    list.add(new Student("Tom", 18, 100, "class05")); list.add(new Student("Jer ...

  8. Competition-based User Expertise Score Estimation-20160520

    1.Information publication:sigir 2011 author:Jing Liu Harbin Institute of TechnologyMicrosoft Researc ...

  9. linux 终端报错 Out of memory: Kill process[PID] [process name] score问题分析

    从Out of memory来看是内存超出了,后面的 Kill process[PID] [process name] score好像和进程有关了,下面我们就一起来看看linux 终端报错 Out o ...

  10. zoj3819Average Score

    Average Score Time Limit: 2 Seconds      Memory Limit: 65536 KB Bob is a freshman in Marjar Universi ...

随机推荐

  1. jQuery.validate的this.optional(element)作用

    今天使用同事扩展jquery validate函数mobile验证时,require值传入false发现也会验证, 去掉mobile后就没这个问题,把mobile替换成自带的digits也没有这个问题 ...

  2. 利用js、css、html固定table的列头不动

    1.CSS <style type="text/css"> #scroll_head { position: absolute; display: none; } &l ...

  3. storm0.9.0.1安装

    storm 0.9.x的好处是引入了netty进行网络传输(需要配置),不用再依赖zeromq和jzmq了 1.下载安装zookeeper ... 2.下载安装storm依赖库 JDK1.6及以上 . ...

  4. jQuery layer[页面弹出框]

    常见接口如下: 方法名 描述 $.layer({}) 核心接口,参数是一个对象,对象属性参见上述列表.诸如layer.alert()之类的为$.layer()的包装方法. layer.v 获取版本号. ...

  5. 1.4.2 solr字段类型--(1.4.2.5)使用枚举字段

    1.4.2 solr字段类型 (1.4.2.1) 字段类型定义和字段类型属性. (1.4.2.2) solr附带的字段类型 (1.4.2.3) 使用货币和汇率 (1.4.2.4) 使用Dates(日期 ...

  6. 【Mood-17】 github中在本地进行上传的时候出现ERROR: Repository not found. fatal: The remote end hung up unexpectedly

    一开始出现这个错误的时候还感觉很奇怪,我明明在在本地中相应的库文件夹命令中输入: vim ./git/config 将文件中的 [remote “origin"]部分去掉!

  7. POI导出EXCEL经典实现

    1.Apache POI简介 Apache POI是Apache软件基金会的开放源码函式库,POI提供API给Java程式对Microsoft Office格式档案读和写的功能. .NET的开发人员则 ...

  8. 剑指Offer43 n个骰子点数概率

    /************************************************************************* > File Name: 43_Dics.c ...

  9. VS2012添加ADO实体数据模型

    最近更新了开发工具为VS2012,在使用EntityFramework创建实体数据模型的时候,在添加选项中找不到这个选项. 确定了自己已经安装了EntityFramework,猜到估计是版本的问题,于 ...

  10. 修复浏览器不支持Array自带的indexOf方法的扩展

    JavaScript中Array的indexOf方法支持的浏览器有:IE9+.Firefox 2+.Safari 3+.Opera 9.5+和Chrome 如果想要在不支持的浏览器中使用indexOf ...