![](https://lstatic.shangxueba.com/sxbzda/h5/images/m_q_title.png)
I ______ that we would be able to leave tomorrow, but it's beginning to look difficult.A.h
I ______ that we would be able to leave tomorrow, but it's beginning to look difficult.
A.hope
B.hoped
C.have hoped
D.had hoped
![](https://lstatic.shangxueba.com/sxbzda/h5/images/tips_org.png)
I ______ that we would be able to leave tomorrow, but it's beginning to look difficult.
A.hope
B.hoped
C.have hoped
D.had hoped
第1题
为使程序的输出结果为: Base:: fun 那么应在下列程序画线处填入的正确语句是()。 #include <iostream> using namespace std; class Base { public: void fun () { cout<<"Base: :fun"<<end1; } }; class Derived : public Base { public: void fun () { cout<<"Derived: :fun"<<end1; } }; int main () { Base a,*pb; Derived b; _________; pb->fun(); //调用基类的成员函数 fun() return 0 ; }
A.pb=&a
B.pb=b
C.pb=&b
D.pb=&Base
第2题
在下面的程序的横线处填上适当的语句,使该程序的输出结果为12。
include<iostream>
using namespace std;
class TestClass
{
public:
int a,b;
TestClass(int i,int j)
{
a=i;
b=j;
}
};
class TestCla
第3题
在下面程序的横线处填上适当的语句,使程序执行后的输出结果为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;)
第4题
为了使程序的输出的正确结果为: Now is 2004.7.10 10:10:10. 那么应在下列程序划线处填入的正确语句是()。 那么应在下列程序划线处填入的正确语句是()。 #include <iostream> using namespace std; class TIME; class DATE { public: DATE(int y=2004,int m=1,int d=1) { year=y; month=m; day=d; } friend void DateTime(DATE &d, TIME &t); private: int year, month, day; }; class TIME { public: TIME(iht h=0, int m=0,int s=0) { hour=h; minute=m; second=s; } friend void DateTime(DATE &d,TIME &t); private: int hour,minute, second; }; ______________________ //函数 DateTime 的首部 { cout<<"Now is"<<d.year<<'.'<<d.month<<'.'<<d.day<< ' '<<t.hour<<":"<<t.minute<<':'<<t.second<<'.'<<end1; } int main () { DATE d(2004,7,10); TIME t(10, 10, 10); DateTime(d,t); return 0; }
A.void DateTime(DATE &d,TIME &t)
B.void TIME::DateTime(DATE &d,TIME &t) const
C.friend void DateTime(DATE &d,TIME &t)
D.void DATE::DateTime(DATE &d,TIME &t)
第5题
A.Base.fun();
B.Base::fun();
C.Base->fun();
D.fun();
第6题
在下列程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 #include<iostream> using namespace std; class A { public:A(){cout<<‘A’;} }; Class B: { public:B(){cout<<‘B’;} }; class C:virtual public A { public:C(){cout<<‘C’;} }; class D:p
A.public A
B.private A
C.protected A
D.virtual public A
第7题
为完成下面的程序,应在划线处填入的语句是 #include<iostream> using namespace std; class Base { private: int x; public: Base(int i) { x=i; } ~Base(){} }; class Derived:public Base { public: ______ //完成类Derive构造函数的定义 }; int main() { Derived obj; return 0; }
A.Derived(int i):Base(i){}
B.Derived(){}
C.Void Derived (int i):Base(i){}
D.Denved(int i){Base(i);}
第8题
为完成下面的程序,应在划线处填入的语句是 #include<iostream> using namespace std; class Base { private: int x; public: Base (int i) { x=i; } ~Base(){} }; class Derived:public Base { public: ______________//完成类Derive构造函数的定义 }; int main() { Derived Obj; return 0; }
A.Derived(int i):Base(i){}
B.Derived(){}
C.void Derived (int i):Base(i){}
D.Derived(int i){Base(i);}
第9题
为完成下面的程序,应在划线处填入的语句是()。 #include <iostream> using namespace std; class Base { private: int x; public: Base(int i) { x=i; } ~Base(){} }; class Derived : public Base { public: _______________ //完成类Derive构造函数的定义 }; int main() { Derived Obj; return 0; }
A.Derived(int i):Base(i){}
B.Derived(){}
C.voidDerived(int i):Base(0){}
D.Derived(int i){Base(i);}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!