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 ...
随机推荐
- 0c-39-ARC下单对象内存管理
1.ARC工作原理详述 ARC是Objective-C编译器的特性,而不是运行时特性或者垃圾回收机制,ARC所做的只不过是在代码编译时为你自动在合适的位置插入release或autorelease A ...
- Oracle的trunc和dbms_random.value随机取n条数据
今天在review项目代码的时候看到这样一个问题,有一张号码表,每次需要从这样表中随机取6个空闲的号码,也就是每次取出来的6个号码应该都会有所不同.然后我就看到了这样的SQL select t.* ...
- 对线性回归,logistic回归和一般回归的认识
原文:http://www.cnblogs.com/jerrylead/archive/2011/03/05/1971867.html#3281650 对线性回归,logistic回归和一般回归的认识 ...
- 入门之--linux配置php
[下载php源码]:从php的官方网站下载php的安装源码包. [解压安装包]:下载的安装包是经过压缩的gz格式,在linux可以使用自带的工具tar进行解压,在安装包所在目录执行命令:tar -zx ...
- 基于EasyUI实现windows桌面
之前为大家介绍了 基于jquery tool实现的windows桌面效果,今天给大家带来一款基于EasyUI实现windows桌面.这款桌面适用浏览器:360.FireFox.Chrome.Safar ...
- spring security源码分析之core包
Spring Security是一个能够为基于Spring的企业应用系统提供声明式的安全访问控制解决方案的安全框架.它提供了一组可以在Spring应用上下文中配置的Bean,充分利用了Spring I ...
- CAKeyframeAnimation 旋转动画
- [Java] String.Split 方法的6个重载函数
String.Split 方法有6个重载函数: 程序代码 1) public string[] Split(params char[] separator) 2) public string[] Sp ...
- jQuery实现轮播图效果
通过改变背景色来达到效果,有下角标和左右箭头,都已经实现. html部分: <!DOCTYPE html> <html> <head> <meta chars ...
- 【阿里云产品公测】OpenSearch初探
作者:阿里云用户 yqzzzz 这两天在折腾站内搜索,下午照例上阿里云网站看看ECS,OSS情况,恰巧看到免费公测的活动,咦,OpenSearch,看起来这不就是我要找的东西么! 1分钟时间填完申请 ...