Visual Basic答题闯关测试题(一)1、一个美国学者提出了一种用方框图来代替传统的程序流程图,该图符合结构化程序设计原则。通常也把这种图称为A) 结构图 B) 数据流图 C) N-S图 D) PAD图 2、根据数据结构中各数据元素之间前后间关系的复杂程度,一般将数据结构分成A) 紧凑结构和非紧凑结构 B) 线性结构和非线性结构 C) 内部结构和外部结构 D) 动态结构和静态结构 3、下列日期的写法正确的是A) { B) # C) D) " 4、在窗体上有多个控件,要实现程序运行后焦点默认在某一控件上,应该设置的属性是A) 设置TabIndex的值为0 B) 设置Index的值为0 C) 设置TabIndex的值为1 D) 设置Enabled的值为True 5、下列程序段的执行结果为X = 2 Y = 5 If X * Y < 1 Then Y = Y - 1 Else Y = -1 End If Print Y - X > 0 A) -1 B) 1 C) True D) False 6、以下语句的输出结果是X = Sqr(29) Print Format$(X, "$####.###") A) 5385 B) 5.385 C) $0005.385 D) $5.385 7、在窗体上画一个命令按钮,然后编写如下事件过程:X = 1 Do X = (X + 1) * (X + 2) Number = Number + 1 Loop Until X >= 30 Print Number, X 程序运行后,输出的结果是 C) 5 12 B) 2 56 D) 10 20 A) 2 3 8、下列程序的执行结果为X = Int(Rnd() + 9) Select Case X Case 10 Print "优秀" Case 9 Print "良好" Case 8 Print "及格" Case Else Print "挂科" End Select A) 优秀 B) 良好 C) 及格 D) 挂科 9、下列程序段的执行结果为X = 75 If X > 60 Then Score = 1 End If If X > 70 Then Score = 2 End If If X > 80 Then Score = 3 End If If X > 90 Then Score = 4 End If Print " Score="; Score A) Score=1 B) Score=2 C) Score=3 D) Score=4 10、下列程序段的执行结果为X = 1 Y = 5 Do X = X + 1 Y = Y + 2 Loop Until X >= 7 Print "X="; X Print "Y="; Y A) X=4 Y=5 B) X=7 Y=15 C) X=6 Y=8 D) X=7 Y=17 11、下面的程序的运行结果是X = 1 Y = 1 Do X = X ^ 2 Y = Y + 1 Loop Until Y > 5 Print "Z="; X; Spc(4); "Y="; Y + X A) Z=7 Y=14 B) Z=6 Y=6 C) Z=4 Y=8 D) Z=1 Y=7 12、单击命令按钮,下列程序的执行结果为Private Sub Command1_Click() Dim X As Integer, Y As Integer X = 32: Y = 42 Call MySub(X, Y) Print X; Y End Sub Public Sub MySub(ByVal n As Integer, ByVal m As Integer) n = n Mod 10 + 1 m = m Mod 10 + 1 End Sub A) 32 42 B) 2 32 C) 2 3 D) 12 3 13、下列程序的执行结果为Private Sub Command1_Click() Dim s1 As String, s2 As String s1 = "abcd" Call inversion(s1, s2) Print s2 End Sub Private Sub inversion(ByVal str1 As String, str2 As String) Dim Tempstr As String Dim i As Integer i = Len(str1) Do While i >= 1 Tempstr = Tempstr + Mid(str1, i, 1) i = i - 1 str2 = Tempstr End Sub A) dcba B) abdc C) abcd D) dabc 14、有如下程序:Private Sub Blck(x As Integer) x = x * 2 + 1 If x < 6 Then Call Blck(x) End If x = x * 2 + 1 Print x; End Sub Private Sub Command1_Click() Blck 2 End Sub 单击命令按钮,下列程序的执行结果是 A) 23 47 B) 10 36 C) 22 44 D) 24 50 15、有如下程序:Private Sub Command1_Click() Dim a As Integer Dim i As Integer a = 2 For i = 1 To 3 Print MyFun(a) Next i End Sub Function MyFun(a As Integer) Dim b As Integer b = 0 Static c b = b + 1 c = c + 1 MyFun = a + b + c End Function 运行上面的程序后,单击命令按钮,输出结果为 A)1 2 3 B)2 3 4 C)4 5 6 D)1 4 6 16、下列过程定义语句中,参数不是对象的定义语句是A) Sub Pro4(y As Control) B) Sub Pro4(x As Form) C) Sub Pro4(x As Currency) D) Sub Pro4(Form1 As Form,Labell As Control) 正确答案: C 17、下列数组定义语句错误的是A) k%=10 Dim Arr(k) B) Const k%=10 Dim Arr(k) C) Dim Arr1(10) As Integer Dim Arr2 (10) D) Dim Arr1(1 To 10) Dim Arr2(1 To 10, 2 To 11) 18、VB中的数值可以用十六进制或八进制表示,十六进制数的开头符是&H,八进制数的开头符号是A) $O B) &O C) $E D) &E 19、下列程序的执行结果为Private Sub Command1_Click() Dim x As Integer, y As Integer x = 12 y = 20 Call MySub(x, y) Print x; y End Sub Private Sub MySub(ByVal a As Integer, ByVal b As Integer) a = a * 2 b = b - 5 Print a; b End Sub A)20 12 20 15 B)12 20 12 25 C)24 15 12 20 D)24 12 12 15 20、下列说法不正确的是A) 属性窗口中属性可以按字母顺序排列 B) 某些属性的值可以跳过不设置,系统自动设为空值 C) 对象的可见性可设为True或False D) 标题的属性值可设为任何文本 |
|
1--15题:CBBAD DBBBD DAAAC 16--20题CABCB 哇,咋错了这么多。修改 删除 引用
|