-
1假定有如下事件过程:Private Sub Form_Click()Dim x As Integer, n As Integerx = 1n = 0Do While x < 28x = x * 3n = n + 1LoopPrint x, nEnd Sub程序运行后,单击窗体,输出结果是
A.81 4
B.56 3
C.28 1
D.243 5
开始考试点击查看答案 -
2在窗体上画一个列表框和一个命令按钮,其名称分别为List1和Command1,然后编写如下事件过程:Private Sub Form_Load()List1.AddItem "Item 1"List1.AddItem "Item 2"List1.AddItem "Item 3"End SubPrivate Sub Command1_Click()List1.List(List1.ListCount) = "AAAA"End Sub程序运行后,单击命令按钮,其结果为
A.把字符串“AAAA”添加到列表框中,但位置不能确定
B.把字符串“AAAA”添加到列表框的最后(即“Item 3”的后面)
C.把列表框中原有的最后一项改为“AAAA”
D.把字符串“AAAA”插入到列表框的最前面(即“Item 1”的前面)
开始考试点击查看答案 -
3在窗体上画两个文本框,其名称分别为Text1和Text2,然后编写如下程序:Private Sub Form_Load()ShowText1.Text = ""Text2.Text = ""Text1.SetFocusEnd SubPrivate Sub Text1_Change()Text2.Text = Mid(Text1.Text, 8)End Sub程序运行后,如果在文本框Text1中输入BeijingChina,则在文本框Text2中显示的内容是
A.BeijingChina
B.China
C.Beijing
D.BeijingC
开始考试点击查看答案 -
4在窗体上画一个命令按钮和一个文本框,其名称分别为Command1和Text1,把文本框的Text属性设置为空白,然后编写如下事件过程:Private Sub Command1_Click()a = InputBox("Enter an integer")b = InputBox("Enter an integer")Text1.Text = b + aEnd Sub程序运行后,单击命令按钮,如果在输入对话框中分别输入8和10,则文本框中显示的内容是
A.108
B.18
C.810
D.出错
开始考试点击查看答案 -
5在窗体上画一个命令按钮,名称为Command1,然后编写如下事件过程:Private Sub Command1_Click()a$ = "software and hardware"b$ = Right(a$, 8)c$ = Mid(a$, 1, 8)MsgBox a$, , b$, c$, 1End Sub运行程序,单击命令按钮,则在弹出的信息框的标题栏中显示的是
A.software and hardware
B.software
C.hardware
D.1
开始考试点击查看答案 -
6有如下程序:Private Sub Form_Click()Dim i As Integer, sum As Integersum = 0For i = 2 To 10If i Mod 2 <> 0 And i Mod 3 = 0 Thensum = sum + iEnd IfNext iPrint sumEnd Sub程序运行后,单击窗体,输出结果为
A.12
B.30
C.24
D.18
开始考试点击查看答案 -
7在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Dim array1(10, 10) As IntegerDim i As Integer, j As IntegerFor i = 1 To 3For j = 2 To 4array1(i, j) = i + jNext jNext iText1.Text = array1(2, 3) + array1(3, 4)End Sub程序运行后,单击命令按钮,在文本框中显示的值是
A.12
B.13
C.14
D.15
开始考试点击查看答案 -
8在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程:Private Sub Command1_Click()Dim a1(4, 4), a2(4, 4)For i = 1 To 4For j = 1 To 4a1(i, j) = i + ja2(i, j) = a1(i, j) + i + jNext jNext iPrint a1(3, 3); a2(3, 3)End Sub程序运行后,单击命令按钮,在窗体上输出的是
A.6 6
B.10 5
C.7 21
D.6 12
开始考试点击查看答案 -
9有如下程序:Option Base 1Private Sub Form_Click()Dim arr, SumSum = 0arr = Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19)For i = 1 To 10If arr(i) / 3 = arr(i) 3 ThenSum = Sum + arr(i)End IfNext iPrint SumEnd Sub程序运行后,单击窗体,输出结果为
A.25
B.26
C.27
D.28
开始考试点击查看答案 -
10在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Dim a(5) As StringFor i = 1 To 5a(i) = Chr(Asc("A") + (i - 1))Next iFor Each b In aPrint b;NextEnd Sub程序运行后,单击命令按钮,输出结果是
A.ABCDE
B.1 2 3 4 5
C.abcde
D.出错信息
开始考试点击查看答案