题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-01-30 01:03:55

[简答题]在下面程序中的下划线处填上适当的语句,使程序的输出结果如下:
11,77
11,77
源程序如下:
#include<iostream>
using namespace std;
class base

private:
int x,y;
public:
void initxy(int a,int b)x=a;y=b;
void show( )
______

void main( )

base a,b;
a.show( );
b=a;
b.show( );

更多"在下面程序中的下划线处填上适当的语句,使程序的输出结果如下: 11,"的相关试题:

[填空题]在下面程序的横线处填上适当的语句,使该程序的输出为12。 #include <iostream> using namespace std; class Base { public: int a; Base(int i){a=i;} }; class Derived: public Base { int a; public: Derived(int x): Base(x),b(x+l){} void show( ) { 【11】 ;∥输出基类数据成员a的值。 cout<<b<<end1; } }; int main( ) { Derived d(1); d.show( ); return 0; }
[填空题]在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。
#include<iostream>
using namespace std;
classA

public:
A( )cout<<’A’;
;
class B:______

public:
B( )cout<<’B’;
;
class C:______

public:C( )cout<<’C’;
;
class D:public B,public C

public:D( )cout<<’D’;
;
void main( )D obj;)
[填空题]在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。 #include<iostream> using namespace std; classA { public: A( ){cout<<’A’;} }; class B:______ { public: B( ){cout<<’B’;} }; class C:______ { public:C( ){cout<<’C’;} }; class D:public B,public C { public:D( ){cout<<’D’;} }; void main( ){D obj;)
[填空题]在下面的程序的横线处填上适当的语句,是该程序的输出为12。
#include<iostream>
using namespace std;
class Base

public:
int a;
Base(int i)a=i;

class Derived:public Base

int a;
public:
Derived(int x):Base(x),b(x+1)
void show( )

【11】 ; //输出基类数据成员a的值。
cout<<b<<endl;


int main( )

Derived d(1);
d.show( );
return 0;

[填空题]在下面的程序的横线处填上适当的语句,使该程序的输出结果为12。 #include<iostream> using namespace std; class TestClass { public: int a,b; TestClass(int i,int j) { a=i; b=j; } }; class TestClass1:public TestClass { int a; public: TestClass1(int x):TestClass(x,x+1){} void show( ) { ______;∥输出基类数据成员a的值 cout<<b<<endl; } }; int main( ) { TestClass1 d(1); d.show( ); return 0; }
[填空题]在下面的程序的横线处填上适当的语句,使该程序的输出为12。
#include <iostream>
using namespace std;
class Base

public:
int a,b;
Base(int i)a=i;
;
class Derived: public Base

int a;
public:
Derived(int x):Base(x),b(x+1)
void show( )

______; //输出基类数据成员a的值。
cout<<b<<endl;

;
int main( )

Derived d(1);
d.show( );
return 0;

[填空题]在下面横线上填上适当的语句,完成程序。 #include <iostream> using namespace std; class Base { int x: public: Base (int i){x=i;} ~Base( ){} }; class Derived : public Base { public: ______ //完成类Derive构造函数的定义 }; int main ( { Derived Obi; return 0; } 在横线外应填入的语句是______。
[填空题]在下面横线上填上适当的语句,完成程序。 #include <iostream> using namespace std; class Base { int x; public: Base(int i) { x=i;} ~Base( ){} }; class Derived: public Base { public: ______∥完成类 Derive构造函数的定义 }; int main( ) { Derived Obj; return 0; } 在横线处应填入的语句是 【9】
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base

int x;
public:
Base(int i) x=i;
~Base( )
;
class Derived: public Base

public:
______∥完成类 Derive 构造函数的定义
;
int main( )

Derived Obj;
return 0;

在横线处应填入的语句是 【11】
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base

int x:
public:
Base (int i)x=i;
~Base( )
;
class Derived : public Base

public:
______ //完成类Derive构造函数的定义
;
int main (

Derived Obi;
return 0;

在横线外应填入的语句是______。
[填空题]在下面横线上填上适当的语句,完成程序。 #include<iostream> using namespace std; class Base { int x; public: Base(int i){x=i;} ~Base( ){} ); class Derived:public Base { public: ______//完成类Derive构造函数的定义 }; iht main( ) { Derived obj; return 0; } 在横线处应填入的语句是______。
[填空题]在下面横线上填上适当的语句,完成程序。
#include<iostream>
using namespace std;
class Base

int x;
public:
Base(int i)x=i;
~Base( )

class Derived:public Base

public:
___________//完成类Derive构造函数的定义

int main( )

Derived Obj;
return 0;

在横线处应填入的语句是______。

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码