首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include using namespace std; class Point{ public: Point(int xx=0,int yy=0):x(xx),
有如下程序: #include using namespace std; class Point{ public: Point(int xx=0,int yy=0):x(xx),
admin
2021-05-06
29
问题
有如下程序:
#include
using namespace std;
class Point{
public:
Point(int xx=0,int yy=0):x(xx),y(yy) { }
protected:
void SetXY(int xx,int yy) { x=xx; y=yy; }
private:
int x,y;
};
class Circle:public Point{
public:
Circle(int r):radius(r) { }
void Set(int r,int x,int y) { radius=r; SetXY(x,y); } //①
void Print() const { cout<
private:
int radius;
};
int main(){
Circle c1(5);
c1.Set(10,1,2); //③
c1.Print(); //④
return 0;
}
在标注号码的语句行中编译时存在语法错误的是
选项
A、①
B、②
C、③
D、④
答案
B
解析
本题考查对象成员的引用,派生类公用继承基类,但是不能继承基类的私有成员,所以执行void Print() const { cout<
转载请注明原文地址:https://kaotiyun.com/show/iGfp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下程序:#includeusingnamespacestd;intmain(){voidfunction(doubleval);doubleval;function
有如下程序:#includeusingnamespacestd;classMountain{intheight;public:Mountain(inth=0):height(h){}
下列描述中,错误的是()。
下列选项中不符合良好程序设计风格的是()。
有如下程序:#includeusingnamespacestd;intmain(){cout.fill(’*’);cout.width(6);cout.fill(’#’
对于语句cout<<endl<<x;中的各个组成部分,下列叙述中错误的是()。
数据库设计过程不包括()。
使用VC6打开考生文件夹下的源程序文件modi1.cpp,但该程序运行时有错,请改正程序中的错误,使程序输出的结果为:numbor1=anumher2=anumbcr1=anumber2_b注意:错误的语句
数据库。DB、数据库系统DBS、数据库管理系统DBMS之间的关系是
数据库应用系统中的核心问题是( )。
随机试题
冷作工用的压弯模,多数采用________制成。
胞质中合成脂肪酸的限速酶是()
患者,女,56岁。咳喘10年,伴见胸闷心悸,咯痰清稀,声低乏力,面白神疲,舌质淡白,脉弱。其证候是
破伤风发生的原因是
属于环境保护法律法规体系的是()。
以下属于业务类:工作底稿的有()。
在对企业境外经营的财务报表进行折算时,下列报表项目中可以按发生时的即期汇率折算的有()。
Americanculturehasnotbeenimmunetoculturalinfluencesfromoutside.TheideaofdemocracycamefromtheancientGreeks;th
PurposesofArtI.AvehicleforreligiousritualThe【T1】_____:primarypatronofartists【T1】______Traditionalsocietie
A、Goforaswim.B、Makebetteruseoftime.C、Followtheofficialprocedure.D、Watchtelevision.C语义替换题。女士建议男士要通过正规渠道来停修课程,所以C(遵
最新回复
(
0
)