下列程序,当单击窗体时s的值是( )
Private Sub Form_Click()
Dim s as boolean
a = 2: b = 3: c = 4: d = 5
s = a >b And 2 * a >c Or c<= d
Print s
End Sub
A.TRUE
B.FALSE
C.-1
D.1
第1题:
在程序运行时,下面的叙述中正确的是
A.用鼠标右键单击窗体中无控件的部分,会执行窗体的Form. L0ad事件过程
B.用鼠标左键单击窗体的标题栏,会执行窗体的Form_Click事件过程
C.只装入而不显示窗体,也会执行窗体的Form. Load事件过程
D.装入窗体后,每次显示该窗体时,都会执行窗体的Form_Click事件过程
第2题:
程序代码如下,当单击窗体上的Command1控件时,在窗体上输出的结果是( )。 Private Sub Command1_Click() Dim aa(3,3)As Integer Dim i As Integer,j As Integer Dim s As Integer For i=0 To 3 For j=0 To 3 aa(i,j)=i*4+j+1 Next j Next i For i=0 To 3 s=s+aa(i,1) Next i Print s End Sub
A.32
B.28
C.30
D.36
第3题:
运行下列程序:
Private Sub form_Click( )
x = 8: y = 2
Call fun1((x), y)
Print x, y
End Sub
Private Sub fun1(x, y)
s = x
x = s / y
y = s Mod y
End Sub
单击窗体后,则在窗体上显示的结果是( )。
A.4 2
B.8 2
C.8 0
D.2 4
第4题:
窗体上命令按钮Commandl的事件过程如下:
Private Sub Command1_Click()
Dim total As Integer
total=s(1)+s(2)
Print total
End Sub
Private Function s(m As Integer)As Integer
Static x As Integer
For i=1 To m
x=x+1
Next i
s=x
End Function
运行程序,第3次单击命令按钮Command1时,输出结果为【 】。
第5题:
运行下列程序:
Private Sub Command1_Click( )
Dim s1 As String * 1
Dim s2 As String
s1 = "a"
For i = Asc(s1) To Asc(s1) + 4
s2 = s2 & Chr(i)
Next i
Print s2
End Sub
单击Command1命令按钮后,则在窗体上显示的结果是( )。
A.a
B.abcde
C.aaaa
D.s2