《职业发展规划执行VisualBasic程序的测试题》由会员分享,可在线阅读,更多相关《职业发展规划执行VisualBasic程序的测试题(68页珍藏版)》请在金锄头文库上搜索。
1、选择题 0分( ) 1.执行下列Visual Basic语言片段程序的结果为何?X = 110If X 120 ThenY = 3 End IfEnd IfPrint Y(A)1 (B)2 (C)3 (D)110 ( ) 2.下列这段BASIC程序代码,可以由身高及性别计算标准体重,计算后所印出的Weight值为何?Sex = FHeight = 170If Sex = M then Weight = (Height - 80) * 0.7Else Weight = (Height - 70) * 0.6End IfPrint Weight(A)54 (B)56 (C)60 (D)63 ( )
2、 3.执行下列Visual Basic程序片段后,Max值为何?A =10: B = 20If A B Then Max = AElse Max = BEnd If(A)10 (B)20 (C)30 (D)Max ( ) 4.执行下列Visual Basic程序后,输出的结果为何?x = 10: y = 4If x = 10 And y = 30 THEN X = X - 20PRINT X(A)3 (B)13 (C)23 (D)43 ( ) 6.在Visual Basic程序语言中,下列何种指令最适合用于多重选择结构中?(A)Do.Loop (B)For.Next (C)Option Bas
3、e (D)Select.Case ( ) 7.执行下列Visual Basic程序后,输出的结果为何?A = 1: B = 2If A 1 Then B = B + 3Print B(A)1 (B)2 (C)3 (D)5 ( ) 8.下列程序叙述中,何者可用来判断BMI值介于18至24之间?(A)If BMI = 18 Or BMI = 18 And BMI = 24 (D)If BMI =18 Or BMI = 24 ( ) 9.执行下列Visual Basic程序后,输出的结果为何?x = 4: y = 1Select Case xCase 1 To 3: y = x + 3 * yCas
4、e 4 To 6: y = x + 5 * yCase 7 To 9: y = x + 7 * yEnd SelectPrint y(A)5 (B)9 (C)10 (D)12 ( ) 10.下列Visual Basic程序之执行结果为何?A = 3: B = 2: C = 1If B = 1 And d = 31 (C)d = 1 ( ) 12.在程序设计的观念中,先测试某一条件再依结果改变执行路径的结构属于(A)循序结构 (B)随机结构 (C)选择结构 (D)多元结构 ( ) 13.执行下列Visual Basic程序后,输出的结果为何?a = 3: b = 5: c = 4If a b T
5、henIf b c Then Print a;ElsePrint b;End IfPrint c(A)4 (B)34 (C)54 (D)354 ( ) 14.执行下列Visual Basic程序后,输出的结果为何?Y = -1If Y 1 Or Y = -1 And Y 0 And Y = 1 Then Print 3Print Y + 1(A)123 (B)23 (C)120 (D)124 ( ) 15.下列Visual Basic程序执行后,总共输出几个$?Private Sub Form_Activate( )X = 3 2Select Case X Case 1: Print $ Ca
6、se 2: Print $ Case Else: Print $End SelectEnd Sub(A)1 (B)2 (C)3 (D)6 ( ) 16.若某家婚友社要利用Visual Basic帮敬民撰写一个可过滤征婚条件是否符合的程序;假设他的择偶条件为:年龄(age)须不满30岁且身高(h)须在165公分(含)以下。请问下列空格处应填入If age 30 ThenIf _ ThenMsgBox (条件符合,可安排双方见面)End IfEnd If(A)h = 165 (B)h = 165 (D)h 165 ( ) 17.执行下列Visual Basic程序片段,会产生哪一种错误的讯息?If
7、 a 5 Thena = a + 3ElseIf b 5 Then a = a - 5(A)没有定义变量的初始值 (B)变量名称没有意义 (C)If条件式中不能使用比较运算子 (D)没有成对的End If ( ) 18.叙述If A 100 And B$ Y Then C = 1 Else C = 2与下列何者同等效果?(A)If A = 100 Or B$ = Y Then C = 2 Else C = 1 (B)If A = 100 And B$ = Y Then C = 2 Else C = 1 (C)If Not (A 100 Or B$ = Y) Then C = 1 Else C
8、= 2 (D)If A 100 And B$ = N Then C = 2 Else C = 1 ( ) 19.执行下列Visual Basic程序片段,出现提示符号时输入任一整数,其输出的结果不可能为下列何者?j = InputBox(input number)a = Sgn(j)Select Case aCase -1: Print ACase 0: Print BCase 1: Print CCase 2: Print DEnd Select(A)A (B)B (C)C (D)D ( ) 20.下列Visual Basic语言片段程序的执行结果为何?A = 1: B = 2If A =
9、B Then B = A 1Print A =A; , B =B (A)A = 1, B = 1 (B)A = 1, B = 2 (C)A = 2, B = 1 (D)A = 2, B = 2 ( ) 21.执行下列Visual Basic程序后,输出的结果为何?If a + b + c ABC ThenPrint YesElsePrint NoEnd If(A)0 (B)Yes (C)No (D)1 ( ) 22.下列Visual Basic语言片段程序执行后,何者正确?a = 5b = 10If (a Mod 2 = 0) Thena = a + 1ElseIf (b Mod 2 = 0)
10、 Thenb = b + 2Elsea = a + 2b = b + 1End If(A)a = 6 (B)a = 7 (C)b = 11 (D)b = 12 ( ) 23.执行下列Visual Basic程序片段,出现提示符号时输入数值10,则输出打印结果为:a = InputBox(input data)b = a Mod 2 3If a b Then Print a - b(A)0 (B)8 (C)11 (D)18 ( ) 24.在Select Case叙述中,下列有关Case子句的用法,何者错误?(A)Case 0 To 10 (B)Case Is 10 (C)Case Is 10 A
11、nd Is 10 ( ) 25.执行下列Visual Basic程序后,输出的结果为何?X = 1: Y = 2: Z = 3X = Z: Y = Z: Z = YPrint X + Z =Select Case X + Z Case Is = Y Print Y Case Is Y Print Z Case Else Print X + YEnd Select(A)X + Z = 9 (B)X + Z = 6 (C)X + Z = 4 (D)X + Z = 3 ( ) 26.下列Visual Basic程序之执行结果为何?D = 400 If D = 100 ThenFare = D * 2 ElseIf D 0 ThenSelect Case a = a + 2Case 2Print ACase 4Print BCase ElsePrint CEnd SelectEnd If