更多"在窗本上放置一个命令按钮Command1, 并编写下列单击事件的程序:"的相关试题:
[单项选择]在窗本上放置一个命令按钮Command1, 并编写下列单击事件的程序: Option Base 1 Private Sub Command1_Click( ) Dim c As Integer, d As Integer d=0 c=6 X=Array(2, 4, 6, 8, 10, 12) For i=1 To 6 If X(i)>c Then d=d+X(i) c=X(i) Else d=d-c End If Next i Print d End Sub
A. 10
B. 12
C. 16
D. 20
[单项选择]在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序:
Option Base 1
Pdvate Sub Command1_Click( )
Dim c As Integer,d As Integer
d=0
c=6
X=Array(2,4,6,8,10,12)
For i=1 To 6
If X(i)>c Then
d=d+X(i)
c=X(i)
Else
d=d-c
End If
Next i
Print d
End Sub
程序运行后,单击命令按钮,则在窗体上输山的结果是( )。
A. 10
B. 12
C. 16
D. 20
[单项选择]在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序:
Option Base 1
Private Sub Commandl_Click0
Dim C As Integer, d As Integer
d=0
c=6
X = Array(2, 4, 6, 8, 10, 12)
For i= 1 To 6
If X(i) > c Then
d = d + X(i)
c = X(i)
Else
d=d-c
End If
Next i
Print d
End Sub
程序运行后,单击命令按钮,则在窗体上输出的内容为( )。
A. 10
B. 12
C. 16
D. 20
[单项选择]在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序:
Option Base 1
Private Sub Command1_Click( )
Dim c As Integer,d As Integer
d=0
c=6
X=Array(2,4,6,8,10,12)
For i=1 To 6
If X(i)>c Then
d=d+X(i)
c=X(i)
Else
d=d-c
End If
Next i
Print d
End Sub
程序运行后,单击命令按钮,则在窗体上输出的结果为( )。
A. 10
B. 12
C. 16
D. 20
[单项选择]在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:
Option Base 1
Private Sub Command1_Click( )
Dim a As Variant
a = Array(1, 2, 3, 4)
j = 1
For i = 4 To 1 Step -1
s = s + a(i)* j
j = j * 10
Next i
Print s
End Sub
运行上面的程序,单击命令按钮,其输出结果是________。
A. 4321
B. 12
C. 34
D. 1234
[填空题]在窗体上画一个命令按钮,其名称为command1,然后编写如下代码:
Option Base 1
Private Sub Command1_ Click( )
Dim Arr
Arr = Array(43, 68f -25, 65, -78, 12, -79, 43, -94, 72)
pos = 0
neg = 0
For k = 1 To 10
If Art(k) > 0 Then
Else
End If
Next k
Print pos, neg
End Sub
以上程序的功能是,计算并输出数组Arr中10个数的整数之和pos与负数之和neg,请填空。
[单项选择]在窗体上画一个命令按钮,其名称为Command1,然后编写如下代码: Option Base 1 Private Sub Command1_Click ( ) Dim a a = Array(1, 2, 3, 4) j = 1 For i = 1 To 4 s = s + a(i) * j j = j * 10 Next i Print s End Sub程序运行后,单击命令按钮,其输出结果是______ 。
A. 1234
B. 12
C. 34
D. 4321