更多"运行下面的程序,单击commandl,在窗体上显示的变量A的值为(),"的相关试题:
[单项选择]下面程序运行时,单击窗体后,窗体上显示的结果是( )。
Private Sub Form_Click( )
Dim I As Integer
Dim sum As Long
sum=0
For I=10 To 16
If I Mod 3=0 OrI Mod 5=0 Then
sum=sum+I
End If
Next I
Print sum
End Sub
A. 10
B. 12
C. 37
D. 22
[单项选择]下面的程序运行时,单击窗体后,窗体上显示的结果是( )。
Private Sub Form_Click( )
Dim a(1 To 6)As Integer
Dim min1%,i%,j%,n%,t%,k%
a(1)=8:a(2)=6:a(3)=9:a(4)=3:a(5)=2:a(6)=7
n=6
For i=1 To n-1
min 1=i
For j=i+1 To n
If a(j)<a(min1)Then min1=j
Next j
t=a(i):a(i)=a(min1):a(min1)=t
Next i
For i=1 To n
Print a(i)
Next i
End Sub
A. 9 8 7 6 3 2
B. 2 3 6 7 8 9
C. 9 8 7 6 3
D. 2 3 6 7 8
[填空题]
运行下面程序,单击CmdRun,在窗体上显示a的值是();b的值是();i的值是()。
Option Explicit
Private Sub CmdRun_Click( )
Dim i As Integer,a As Integer,b As Integer
a=1:b=10
For i=a To b Step a+1
a=a+1
b=b+1
i=i+1
Next i
Print a,b,i
End Sub
[填空题]
运行下面的程序,单击Cmd1,窗体上显示的第一行是(),第二行是() ,最后一行是()。
Option Explicit
Private Sub Cmd1_Click( )
Dim A As Integer
A=3
Call Sub1(A)
Print A
End Sub
Private Sub Sub1(X As Integer)
X=X*2+1
If X<10 Then
Call Sub1(X)
End If
X=X*2+1
Print X
End Sub
[单项选择]执行下面的程序,单击窗体后在窗体上显示的结果是 ______。Private Sub form_ Click( ) Dim Str1 As String, Str2 As String Dim Str3 As String, I As Integer Str1 = "e" for I = t To 2 Str2 = Ucase (Str1) Str1 = Str2 & Str1 Str3 = Str3 & Str1 str1 = Chr (Asc(Str1) + I) Next I Print Str3End Sub
A. EeFF
B. eEfF
C. EEFF
D. eeFF
[单项选择]窗体上有一个名称为Hscroll1的滚动条,程序运行后,当单击滚动条两端的箭头时,立即在窗体上显示滚动框的位置(即刻度值)。下面能够实现上述操作的事件过程是( )
A. Private Sub Hscroll1_Change()
B. Private Sub Hsetroll1_Change()
C. Private Sub Hscroll1_Scroll()
D. Private Sub Hscroll1_Scroll()
[单项选择]窗体上有一个名称为HScroll1的滚动条,程序运行后,当单击滚动条两端的箭头时,立即在窗体上显示滚动框的位置(即刻度值)。下面能够实现上述操作的事件过程是______。
A. Private Sub HScroll1_Scroll()
B. Private Sub HScroll1_Scroll()
C. Private Sub HScroll1_Change()
D. Private Sub HScroll1_Change()
[填空题]下列程序运行后,单击窗体,在窗体上显示:1,1+2,1+2+3,1+2+3+4,1+2+3+4+5的和。请在横线处填写适当的内容,将程序补充完整。
Private Sub Form_Click( )
Dim i As Integer,tt As Integer
Fori=1 To 5
tt=Sum(i):Print "tt=";tt,
Next i
End Sub
Private Function Sum(______)
______
j=j+n
Sum=j
End Function
[填空题]运行下列程序,单击Command1命令按钮后,则在窗体上显示第一行和第二行的结果分别是 (14) 和 (15) 。
Private Sub Command1_Click( )
t = 1: x = 2: y = 3: z = 4
If t > 0 Or t = x And x <> y Or y > z Then
t = fun1(t, z)
Print t
Else
t = fun1(x, y)
Print t
End If
Print x
Print y
End Sub
Function fun1(ByVal x As Integer, ByVal y As Integer)As Integer
Do While y <> 0
t = x / y
x = y
y = t
Loop
fun1 = x
End Function
[单项选择]以下程序运行时,单击窗体后,在窗体上输出的结果是 ______。
Private SubForm_Click( )
Dim a As Integer,b As Integer
a=10 :b=20
Call ff(a,B)
Print a,b
End Sub
Private Sub ff(x As Integer,y As Integer)
x=x+y
y=x+y
End Sub
A. 30 50
B. 30 30
C. 20 20
D. 10 20
[单项选择]窗体上有一个名称为Option1的单选按钮控件。当程序运行,并单击某个单选按钮时,会调用下面的事件过程:
Private Sub Option1_Click(Index As Integer)
…
End Sub
下面关于此过程的参数Index的叙述中正确的是( )
A. Index为1表示单选按钮被选中,为0表示未选中
B. Index的值可正可负
C. Index的值用来区分哪个单选按钮被选中
D. Index表示数组中单选按钮的数量
[填空题]运行下列程序,单击Command1,在窗体上显示的第一行内容是(),第二行的内容是(),第三行的内容是()("A"的ASCII码是65,"z"是90) Option Explicit Private Sub Commandl_Click( ) Dim i As Integer,st As String,n As Integer,p As String*1 P="B" For i=3 To 1 Step -1 n=Asc(p)-i If n<65 Then n=n+26 st=Chr(n) st=st & F(i) Print st Next i EndSub Private Function F(n As Integer) Dim i As Integer Static S As Integer For i=1 To n s=s+i Nexti F=S End Function
[填空题]下列程序运行时,单击窗体,执行结果为 【12】 。
说明:在窗体上有一Label控件,名为lblDate。
Dim Y As Integer,m As Integer,d As Integer,w1 As Integer
Dim Rq As Date
Dim W2 As String
Private Sub Form_Click( )
Rq=Date
Y=Year(Rq): m=Month(Rq)∶d=Day(Rq)
w1=Weekday(x)
Select Case w1
Case 1
W2="日"
Case 2
W2="一"
Case 3
W2="二"
Case 4
W2="三"
Case 5
W2="四"
Case 6
W2="五"
Case 7
W2="六"
End Select
bldate.Caption="今天是"&Y&"年"&m&"月"&d&"日"&"星期"&W2
End SUb
[填空题]
执行下面程序,单击按钮CmdRun,窗体上显示的第一行结果是(),UBound(a)的值为(),其中a(1)的值为().
Option Explicit
Private Sub CmdRun_Click( )
Dim St As String,i As Integer
Dim a( ) As String,j As Integer,k As Integer
St="abcd"
Call Sub1(St)
Print St
For i=1 To Len(St)
For j=i+1 To Len(St)
If Mid(St,i,1)=Mid(St,j,1) Then Exit For
Next j
If j>Len(St) Then
k=k+1
ReDim Preserve a(k)
a(k)=Mid(St,i,1)
Print "a(";k;")=";a(k)
End If
Next i
End Sub
Private Sub Sub1(S As String)
Dim i As Integer
For i=1 To Len(S)/2
Mid(S,i,1)=Mid(S,Len(S)-i+1,1)
Next i
End Sub
[填空题]下面程序段的作用:在窗体上一个命令按钮。单击命令按钮后,将程序中字符串 "Welcome Home"中的字符全部大写输出,其后字符"Wel Back"全部小写输出。请填空。
Private Sub Command1_Click( )
a = "Welcome Home";
b = "Wel Back"
c = 【8】 + LCase(b)
Print c
End Sub