首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #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
2020-05-14
22
问题
有如下程序:
#include
using namespace std;
class Point{
public:
Point(int xx=0,int yy=0):x(xx),y(yy) { }
void SetXY(int xx,int yy) { x=xx; y=yy; }
protected:
int x,y;
};
class Circle: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.SetXY(10,1,2); //③
c1.Print(); //④
return 0;
}
在标有号码的语句行中存在语法错误的是
选项
A、①
B、②
C、③
D、④
答案
C
解析
C选项中SetXY为基类的成员函数,派生类也继承下来,但是SetXY的参数为两个,而③调用时是3个参数,所以错误。
转载请注明原文地址:https://jikaoti.com/ti/VCA0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有:inta=10,b=9,c;则在计算表达式c=(a%11)+(b=3),c+=2后,变量c的值为【】。
继承的方式有公有继承、私有继承和______3种。
A、 B、 C、 D、 C面向对象方法具有封装性、继承性、多态性几大特点。就是这几大特点,为软件开发提供了一种新的方法学。封装性:所谓封装就是将相关的信息、操作与处理融合在一个内含的部件中(对象中)。它是面向
下面关于纯虚函数和抽象类的描述中,______是错误的。
对于一个类定义,下列叙述中错误的是()。
数据库的数据模型所描述的内容有三个部分,它们是()。
关系数据库管理系统能实现的专门关系运算包括()
C++语言的参数传递机制包括传值和传地址两种,如果调用函数时,需要改变实参或者返回多个值,应该采取【】方式。
语句ofstreamf("DATA.DAT",ios_base::applios_lios_base::binary);的功能是建立流对象f,并试图打开文件DATA.DAT并与之连接,而且()。
下面不能作为结构化方法软件需求分析工具的是
随机试题
加强药品质量的监督管理体现的是指药品特殊性的( )人们在需要用药时,时间就是生命,它体现了药品特殊性中的( )
肾俞穴属于足少阴肾经。()
Addingasuitabletag:You’dratherIdidn’tshowupthesedays.
患者男,60岁。因进行性吞咽困难4个月就诊入院,经食管镜检查示食管中段6cm长之管腔狭窄,黏膜中断,病检报告为鳞癌Ⅱ级。体查锁骨上无肿大淋巴结,无声嘶。对于该患者推荐的放射治疗剂量为
我国学者发现能治疗消化性溃疡的抗生素是
以下属于行政法规的是
采用修正的总费用法进行索赔费用的计算时,通常在总费用法的基础上进行一些修正,修正的因素主要有()。
投资银行业务可能因管理不善而导致的风险有()。
(2015年改)甲公司购买一台新设备进行旧设备更新。新设备购买价为36000元,预计使用寿命10年,预计净残值为4000元(与最终报废残值一致),采用年限平均法计提折旧(与税法要求一致),每年营运成本为8000元,假设当期折现率为10%。公司适用的所
下列酒类产品中,包装物押金应并人销售收入计征消费税的有()。
最新回复
(
0
)