首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
公务员
下面的C++程序定义一个Student类,该类包含两个函数,aver函数是求一个学生两门课的平均值,Student函数是带参数的构造函数。请在划线处补充成分使程序完整。 #include(iostream.h) class Student
下面的C++程序定义一个Student类,该类包含两个函数,aver函数是求一个学生两门课的平均值,Student函数是带参数的构造函数。请在划线处补充成分使程序完整。 #include(iostream.h) class Student
admin
2017-05-04
48
问题
下面的C++程序定义一个Student类,该类包含两个函数,aver函数是求一个学生两门课的平均值,Student函数是带参数的构造函数。请在划线处补充成分使程序完整。
#include(iostream.h)
class Student
{
public:
Student(noat ma,noat ph)
{
①__________;
②__________;
}
float avet(float ma,float ph)
{
agv=③__________;
return(agv);
}
private:
noat math:
noat phy;
noat agv;
}
}
选项
答案
①math=ma ②phy=ph ③(math+phy)/2;
解析
因为Student函数是带参数的构造函数,所以用参数表里面的参数ma、ph来初始化类Student里的数据成员math、phy。根据平均函数的公式得出平均数是二者和的一半。
转载请注明原文地址:https://jikaoti.com/ti/z8F9FFFM
本试题收录于:
中学信息技术题库教师公开招聘分类
0
中学信息技术
教师公开招聘
相关试题推荐
耐久跑的呼吸方法,一般采用()呼吸。
体育与健康基础知识课堂教学中应注意的问题。
根据课的任务和教材的特点,准备部分可_______也可分组进行,既可定位也可行进间做,队形变化可以多种多样。
田径运动会组织方案是大会一切工作的依据,_______是竞赛工作的依据。
国际田径协会联合会规定,从2003年1月1日起,除标枪外,各投掷项目_______、_______和_______落地区标志线的内沿延长线的夹角为度,铅球和链球投掷圈内沿直径应为_______米。
世界性摔跤比赛的场地四周应设不少于()宽的保护区。
两名对抗的队员大约同时互相发生接触犯规的情况是()。
美术史是研究________的学问,包括有关美术作品、美术家、流派和风格的信息、阐释和评价。
绘画造型要素有线、形、色彩、空间、()。
具有浓郁民族风格和传统文化特点的水墨动画片是中国独创的动画片种类,下列属于水墨动画片的是()
随机试题
A.一倍以上三倍以下的罚款B.一倍以上五倍以下的罚款C.二倍以上三倍以下的罚款D.二倍以上五倍以下的罚款E.三倍以上五倍以下的罚款生产、销售劣药的,没收违法生产、销售的药品和违法所得,并处违法生产、销售药品货值金额
狂犬病毒经过系列传代适应特定宿主后可称之为
下列属于胶片感光特性的参数是
枳壳中主含挥发油,其挥发油中主要含有的成分是()。
甲的妻子遭遇车祸,造成严重脑震荡,甲为筹集巨额治疗费用,不得不将自己的一块名表出售于乙。乙见甲处境困顿,明知该表价值10万元,却提出以1万元购买。甲讨价还价再,乙始终不让步,甲无奈于2006年2月1日将该表以1万元的价格出售于乙。半年后,甲妻病故。甲于20
在渐开线齿廓上,()圆上的压力角为零,()圆上的压力角最大。
企业销售商品时代垫的运杂费应记入()科目。
下列对销项税额的处理,错误的是()。
3
Readthefollowingtextanddecidewhichanswerbestfitseachspace.Forquestions26-45,markoneletterA,B,CorDony
最新回复
(
0
)