下列程序输出的结果为【 】。
Private Sub Commandl_Click( )
Dim a As Boolean
a = True
If a Then GoTo 11 Else GoTo 22
11:
Print "VB";
22:
Print "VC"
End Sub
第1题:
下列程序的输出结果为:
bjectid=O
biectid=1
请将程序补充完整。
include<iostream>
using namespace std;
class Point
{
public:
Point(int xx=0,int yy=0){X=xx;Y=yy;countP++;}
~Point(){countP--;}
int GetX(){return X;}
int GetY(){return Y;}
static void GetC(){cout<<"Object id="<<countP<<endl;}
private:
int X,Y;
static int countP;
};
______//静态数据成员的初始化
int main()
{
Point::GetC();
Point A(4,5);
A.GetC();
return 0;
}
第2题:
下面这个程序的结果是 #include<iostream.h> class A { private: int a; public: void seta( );int geta( );}; void A::seta( ) { a = 1;} int A::geta( ) {return a;} class
A.1
B.2
C.随机输出1或2
D.程序有错
第3题:
在标准模块中用:Dim或Private关键字定义的变量是______变量,它们只能在程序的模块中使用。
第4题:
下列程序的输出结果为
Object id=0
Obiect id=1
请将程序补充完整。
include<iostream>
using namespace std;
class Point
{
public:
Point(int xx=O,int yy=O){X=xx;Y=yy;countP++;}
~Point(){countp--;}
int GetX()(return X;)
int GetY(Xremm Y;)
static void GetC(){cout<<"Objcetid="<<countp<<endl;}
private:
int X,Y;
static int countP;
}:
【 】。 //静态数据成员的初始化
int main()
{
Point::GetC();
Point A(4,5);
A.GetC()
return 0;
}
第5题:
下列程序的输出结果为
Object id=0
Object id=1
请将程序补充完整。
include <iostream>
using namespace std;
class Point
{
public:
Point(int xx=0,int yy=0) {X=xx;Y=yy;countP++;}
~Point(){countP--;}
int GetX(){return X;}
int GetY(){return Y;}
static Void GetC(){cout<<"Object id="<<countP<<endl;}
private:
int X,Y;
static int countP;
};
______ //静态数据成员的初始化
int main ()
{
Point::GetC();
Point A(4,5);
A.GetC();
return 0;
}
第6题:
若有以下程序:
include <iostream>
using namespace std;
class Sample
{
private:
const int n;
public:
Sample(int i) :n(i) {)
void print()
{
cout<<"n="<<n<<end1;
}
};
int main()
{
sample a(10);
a.print();
return 0;
}
上述程序运行后的输出结果是【 】。