若有如下定义,选项中不正确的语句是_________。 Structure MyStru Dim No as integer Dim Gender As Char End Structure Dim s(100) AS MyStru
A.MyStru是结构变量
B.s是结构数组
C.s(0).No=1234是正确的赋值语句
D.Gender是结构中的一个成员
E.s(1)是数组中的一个元素
第1题:
设有如下的用户定义类型: Type Student number As String name As string age As Integer End Type 则以下正确引用该类型成员的代码是______。
A. Student name="李明”
B.Dim s As Student s.name="李明"
C.Dim s As Type Student s.name="李明"
D.Dim s As Type s.name="李明"
第2题:
如下数组声明语句,正确的是( )。
A. Dim a[3, 4] As Integer
B. Dim a(34) As Integer
C. Dim a(n,n) As Integer
D. Dim a(3,4) As Integer
第3题:
以下有关数组定义的语句序列中,错误的是
A.Static arrl(3) arr1(1)=100 arrl(2)="Hello" arrl(3)=123.45
B.Dim arr2()As Integer Dim size As Integer Private Sub Command2_Click() size=InputBOX(“输入:”) ReDim arr2(size) ┄ End Sub
C.Option Base 1 Private Sub Command3_Click() Dim arr3(3)As Integer ┄ End Sub
D.Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer ┄ End Sub
第4题:
下列数组定义语句中,错误的是( )。
A.Static a(10) As Integer
B.Dim c(3,1 To 4)
C.Dim d(-10)
D.Dim b(0 To 5,1 To 3)As Integer
第5题:
有如下函数过程: Function lj(x As Integer) As Long Dim s As Long Dim i As Integer s=0 For i = 1 To x s=s+ i Next i 1j= s End Function在窗体上添加一个命令按钮,名为Command1, 编写事件过程调用该函数: Private Sub Command1 Click() Dim i As Integer Dim sum As Long For i = 1 To 5 sum = sum + 1j(i) Next i Print sum End Sub
A. 25
B.35
C.45
D.55
第6题:
有如下函数:Private Function firstfunc(x As Integer, y As Integer) As Integer Dim n As Integer Do While n <= 4 x=x +y n=-+1 Loop firstfunc = x End Function调用该函数的事件过程如下:Private Sub Command1_lick() Dim x As Integer Dim y As Integer Dim n As Integer Dim z As Integer x=1 y=1 For n = 1 To 3 z = firstfunc(x, y) Next n Print z End Sub该事件过程的执行结果是 ______。
A.1
B.3
C.16
D.9
第7题:
有如下函数过程: Function gys(ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 reminder = x Mod y x=y y=reminder Loop gys=x End Function以下是调用该函数的事件过程,该程序的运行结果是______。 Private Sub Command7_Click() Dim s As Integer Dim b As Integer a=100 b=25 x=gys(a,B)Print x End Sub
A. 0
B.25
C.50
D.100
第8题:
以下将变量NewVar定义为Integer型正确的是______。
A.Integer NewVar
B.Dim NewVar Of Integer
C.Dim NewVar As Integer
D.Dim Integer NewVar
第9题:
定义数组语句Dim a(b) As Integer 是正确的。
A对
B错
第10题:
在VB中,使用变量前一般应对变量进行定义。以下变量定义语句错误的是()。
第11题:
定义数组语句Dim a(b)As Integer是正确的
第12题:
用语句Dim A (-3 To 5) As Integer定义的数组的元素个数是()
第13题:
定义有5个整数型元素的数组,正确的语句是
A.Dim a(4) As Integer
B.Option Base 1:Dim a(5)
C.Dim a &(5)
D.Dime a(5) As Integer
第14题:
设有如下的记录类型: TypeStudent number As String name AS String age As Integer End Type 则正确引用该记录类型变量的代码是( )。
A.Student.name="张红"
B.Dim s As Student s.name="张红"
C.Dim s As Type Student s.name="张红"
D.Dim s As Type s.name="张红"
第15题:
以下有关数组定义的语句序列中,错误的是 ______。
A.Static arrl(3) arrl(1)=100 arrl(2)="Hello" arrl(3)123.45
B.Dim arr2()As Integer Dim size As Integer Private Sub Command2_click() size=InputBox("输入:") ReDimarr2(size) End Sub
C.Option Base1 Private Sub Command3_click() Dim arr3(3)As Integer End Sub
D.Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer End Sub
第16题:
下列数组定义语句错误的是
A.k%=10 Dim Arr(k)
B.Const k%=10 Dim Arr(k)
C.Dim Arrl(10) As Integer Dim Arr2(10)
D.Dim Arrl(1 To 10) Dim Arr2(1 To 10,2 To 11)
第17题:
有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为( )。
A.12
B.24
C.36
D.48
第18题:
有如下一个Sub过程: Sub mlt (ParamArray numbers()) n=1 For Each x In numbers n=n * x Next x Print n End Sub在一个事件过程中如下调用该Sub过程: Private Sub Coinmand1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 则运行该程序,结果为______。
A.12
B.24
C.36
D.48
第19题:
下列数组说明语句正确的是
A.Dim g(0,-5)As Single
B.Dim h(100 To 100,100)As String
C.Dim x(5)As Integer ReDim x(10)As Integer
D.Dim y() ReDim y
第20题:
以下有关数组定义的语句序列中,错误的是( )。
A.Static arr1(3) arr1(1)=100 arr1(2)="Hello" arr1(3)=123.45
B.Dim arr2() AsInteger Dim size As Integer Private Sub Command2_Click () size=InputBox("输入:") ReDim arr2(size) …… EndSub
C.Option Base 1 Private Sub Command3 Click() Dim art3(3) As Integer …… End Sub
D.Dim n As Integer Private Sub Command4 Cliok() Dim arr4(n)As Integer …… End Sub
第21题:
VB中,定义a为实型变量的语句是()。
第22题:
下列数组声明语句,正确的是()。
第23题:
在VBA中要定义一个100元素的个整型数组,正确的语句是()
第24题:
如下数组声明语句,正确的是()。