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 ...
随机推荐
- 项目源码--Android即时通讯IM客户端
下载源码 技术要点: 1.完整精美客户端UI设计 2.自定义控件的灵活使用 3.UI控件的详细使用 4.即时通讯IM协议的实现 5.完整即时通讯IM客户端实现 6.源码详细的中文注释 ……. ...
- Replace INTO与INSERT INTO的不同之处
Replace INTO和INSERT INTO的区别: REPLACE的运行与INSERT很相似.只有一点例外,假如表中的一个旧记录与一个用于PRIMARY KEY或一个UNIQUE索引的新记录具有 ...
- 远程MSMQ
简介 MSMQ(微软消息队列)是Windows操 作系统中消息应用程序的基础,是用于创建分布式.松散连接的消息通讯应用程序的开发工具.消息队列和电子邮件有着很多相似处,他们都包含多个属性,用于保存消息 ...
- openvpn - unable to browse internet after connect to openVPN
Using iptables Use an iptable for NAT forwarding: # iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ...
- DataGridView 多线程更新 数据 解决卡顿问题
使用多线程更新DataGridView,防止页面卡顿和卡死的问题 private delegate void UpdateDataGridView(DataTable dt); private voi ...
- WebApi 部署后一直返回404的解决办法
Fixing ASP.NET MVC 4 Web API 404 Posted on November 5, 2012 For a Web Service providing some REST-st ...
- ajax步骤和理解
步骤: 1.利用html+css来实现页面,表达信息: 2.用XMLHttpRequest和web服务器进行数据的异步交换 3.运营js操作DOM,实现动态局部刷新: XMLHttpRequest对象 ...
- 【Shell脚本学习18】Shell for循环
与其他编程语言类似,Shell支持for循环. for循环一般格式为: for 变量 in 列表 do command1 command2 ... commandN done 列表是一组值(数字.字符 ...
- android 使用<merge>标签
<merge /> 标签在你嵌套 Layout 时取消了 UI 层级中冗余的 ViewGroup .比如,如果你有一个 Layout 是一个竖直方向的 LinearLayout,其中包含两 ...
- vb6如何将MSHFlexGrid控件中的内容导出为Excel
首先的是是准备工作 需要引用 Microsoft Excel 11.0 Object Library 需要添加控件Mircrosoft Hierarchical FlexGrid Control 6. ...