score
#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的更多相关文章
- Lucene的评分(score)机制研究
首先,需要学习Lucene的评分计算公式—— 分值计算方式为查询语句q中每个项t与文档d的匹配分值之和,当然还有权重的因素.其中每一项的意思如下表所示: 表3.5 评分公式中的因子 评分因子 描 述 ...
- 设有一数据库,包括四个表:学生表(Student)、课程表(Course)、成绩表(Score)以及教师信息表(Teacher)。
一. 设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表(一)~表( ...
- 关于一道数据库例题的解析。为什么σ age>22 (πS_ID,SCORE (SC) ) 选项是错的?
本人大二学子.近段时间在做数据库复习题的时候遇到一道题,如下. 有关系SC(S_ID,C_ID,AGE,SCORE),查找年龄大于22岁的学生的学号和分数,正确的关系代数表达式是( ) . ⅰ. πS ...
- 利用SCORE法则来总结一次偷懒的单元测试过程
最近遇到一个单元测试的问题,本周正好学个了一个SCORE法则,这里正好练练手应用此法则将问题的前因后果分享给大家. S:背景 代码要有单元测试,检测的标准就是统计代码的单元测试覆盖率,程序员需要达到 ...
- Hiho coder 1236 2015 北京网络赛 Score
五维偏序..一开始被吓到了,后来知道了一种BITSET分块的方法,感觉非常不错. 呆马: #include <iostream> #include <cstdio> #incl ...
- 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; ...
- 第三题 有如下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 ...
- Competition-based User Expertise Score Estimation-20160520
1.Information publication:sigir 2011 author:Jing Liu Harbin Institute of TechnologyMicrosoft Researc ...
- linux 终端报错 Out of memory: Kill process[PID] [process name] score问题分析
从Out of memory来看是内存超出了,后面的 Kill process[PID] [process name] score好像和进程有关了,下面我们就一起来看看linux 终端报错 Out o ...
- zoj3819Average Score
Average Score Time Limit: 2 Seconds Memory Limit: 65536 KB Bob is a freshman in Marjar Universi ...
随机推荐
- shell 编程中使用到得if语句内判断参数
http://blog.chinaunix.net/uid/21411227/cid-63616-list-1.html 1.判断文件类型 –b 当file存在并且是块文件时返回真 -c 当fil ...
- XCode4中的文本查找和文本替换功能
转自:http://blog.csdn.net/zhuzhihai1988/article/details/7843186 1.如果是在打开的文档范围内: 查找: Command+ F ...
- npm常用命令->nodejs
npm install <name>安装nodejs的依赖包 例如npm install express 就会默认安装express的最新版本,也可以通过在后面加版本号的方式安装指定版本, ...
- 项目源码--Android聚合视频类播放器
下载源码 技术要点: 1.高效支持主流的视音频格式 2.本地视频的播放与管理 3.聚合电视在线直播 4.聚合优酷.搜狐.乐视.爱奇艺等多种在线视频 5.优质播放,包含播放.暂停,声音.亮度调整等功能 ...
- Control.Refresh Control.Invalidate 和 Control.OnPaint之间的联系和区别
1.Control.Invalidate会放一个WM_PAINT消息到消息队列,当Control处理到该消息的时候,就调用OnPaint. 2.Control.Refresh相当于以下两行:Contr ...
- ubuntu thrift 0.9.3编译安装
Table of Contents 1. 下载thrift源代码 2. 编译并安装 3. 运行测试程序 4. 安装 1 下载thrift源代码 git clone https://git-wip-us ...
- LeetCode17 Letter Combinations of a Phone Number
题意: Given a digit string, return all possible letter combinations that the number could represent. A ...
- WPF 之 TreeView右键选中节点及节点重命名
下面的TreeView节点是通过数据双向绑定的方式,绑定到TextBlock控件和TextBox控件的Text属性上,并且让两者绑定相同的属性,同时使TextBox控件刚好完全覆盖TextBlock控 ...
- WPF 之 文本框及密码框添加水印效果
1.文本框添加水印效果 文本框水印相对简单,不需要重写模板,仅仅需要一个 VisualBrush 和触发器验证一下Text是否为空即可. <TextBox Name="txtSerac ...
- Android 高级UI设计笔记12:ImageSwitcher图片切换器
1. ImageSwitcher ImageSwitcher是Android中控制图片展示效果的一个控件,如:幻灯片效果...,颇有感觉啊.做相册一绝 2. 重要方法 setImageURI(Uri ...