有如下程序:
Private Type stu
X As String
Y As Integer
End Type
Private Sub Command1 Click( )
Dim a As stu
X="ABCD"
Y=12345
Print a
End Sub
程序运行时出现错误,错误的原因是( )。
A.Type定义语句没有放在标准模块中
B.变量声明语句有错
C.赋值语句不对
D.输出语句Print不对
第1题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub Commandl_Click( )
Static X As Integer
Static Y As Integer
Cls
Y=1
Y=Y+5
X=5+X
Print X, Y
End Sub
程序运行时,3次单击命令按钮Command1后,窗体上显示的结果为【 】。
第2题:
有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。
A.print1
B.print2
C.print1 print2
D.程序编译时出错
第3题:
有如下程序: #include <iostream> using namespace std; class sample { private: int x, y; public: sample(int i,int j) { x=i; y=j; } void disp() { cout<<"displ"<<end1; } void disp() const { cout<<"disp2"<<end1; } }; int main () { const sample a(i,2); a.disp (); return 0; } 该程序运行后的输出结果是( )。
A.disp1
B.disp2
C.disp1 disp2
D.程序编译时出错
第4题:
有类定义如下:
class Type{
public:
Type(int i=0);
Type operator-(int);
friend Type operator+(Type,Type);
private:
int val;
};
若有对象定义Type c1;则下列语句序列中,错误的是
A.Type(3)+c1;
B.c1+Type(3);
C.3-c1;
D.c1-3;
第5题:
程序段如下:Private Sub Command1_ Click() a = 0 for 1=15 To 15 Step- 2 a = a +1 Next I Print a, IEnd Sub发生Command 1的单击事件后,程序的输出结果是 ______。
A.0 13
B.15 13
C.0 15
D.15 15
第6题:
A.type array arr_type[emp.ename%type] index by binary_integer;
B.type table arr_type[emp.ename%type] index by binary_integer;
C.type arr_type is table of emp.ename%type index by binary_integer;
D.type arr_type is pl_sql table of emp.ename%type index by binary_integer;